in tools/hakari/src/proptest_helpers.rs [109:136]
fn traversal_excludes() {
for (&name, fixture) in JsonFixture::all_fixtures() {
let graph = fixture.graph();
let workspace = graph.workspace();
let strategy =
HakariBuilder::prop010_strategy(graph, option::of(workspace.prop010_id_strategy()));
proptest!(|(builder in strategy, queries in vec(graph.prop010_id_strategy(), 0..64))| {
// Ensure that the hakari package is omitted.
if let Some(package) = builder.hakari_package() {
assert!(
builder.is_traversal_excluded(package.id()).expect("valid package ID"),
"for fixture {}, hakari package is excluded from traversals",
name,
);
}
// Ensure that omits_package and omitted_packages match.
let traversal_excludes: HashSet<_> = builder.traversal_excludes().collect();
for query_id in queries {
assert_eq!(
traversal_excludes.contains(query_id),
builder.is_traversal_excluded(query_id).expect("valid package ID"),
"for fixture {}, traversal_excludes and is_traversal_excluded match",
name,
);
}
});
}
}