Skip to content

Commit dc54f10

Browse files
committed
assert JSON success in proc macro build tests
1 parent 107722e commit dc54f10

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/docbuilder/rustwide_builder.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,31 @@ mod tests {
17351735
let source_archive = source_archive_path(crate_, version);
17361736
assert!(storage.exists(&source_archive)?);
17371737

1738+
let path = rustdoc_json_path(
1739+
crate_,
1740+
version,
1741+
HOST_TARGET,
1742+
RustdocJsonFormatVersion::Latest,
1743+
);
1744+
assert!(storage.exists(&path)?);
1745+
assert!(storage.get_public_access(&path)?);
1746+
1747+
let json_prefix = format!("rustdoc-json/{crate_}/{version}/{}/", HOST_TARGET);
1748+
let mut json_files: Vec<_> = storage
1749+
.list_prefix(&json_prefix)
1750+
.filter_map(|res| res.ok())
1751+
.map(|f| f.strip_prefix(&json_prefix).unwrap().to_owned())
1752+
.collect();
1753+
json_files.sort();
1754+
dbg!(&json_files);
1755+
assert_eq!(
1756+
json_files,
1757+
vec![
1758+
format!("empty-library_1.0.0_{HOST_TARGET}_45.json.zst"),
1759+
format!("empty-library_1.0.0_{HOST_TARGET}_latest.json.zst"),
1760+
]
1761+
);
1762+
17381763
Ok(())
17391764
});
17401765
}

0 commit comments

Comments
 (0)