Skip to content

Commit a773433

Browse files
Test Souffle versions of Polonius analyses
1 parent 3ca3f55 commit a773433

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ use std::path::Path;
1717
fn test_facts(all_facts: &AllFacts, algorithms: &[Algorithm]) {
1818
let naive = Output::compute(all_facts, Algorithm::Naive(Engine::Datafrog), true);
1919

20+
let souffle_naive = Output::compute(all_facts, Algorithm::Naive(Engine::Souffle), false);
21+
assert_equal(&naive.errors, &souffle_naive.errors);
22+
assert_equal(&naive.subset_errors, &souffle_naive.subset_errors);
23+
2024
// Check that the "naive errors" are a subset of the "insensitive
2125
// ones".
2226
let insensitive = Output::compute(all_facts, Algorithm::LocationInsensitive, false);
@@ -82,6 +86,12 @@ fn test_facts(all_facts: &AllFacts, algorithms: &[Algorithm]) {
8286
assert_equal(&naive.errors, &opt.errors);
8387
assert_equal(&naive.subset_errors, &opt.subset_errors);
8488
assert_equal(&naive.move_errors, &opt.move_errors);
89+
90+
if matches!(optimized_algorithm, Algorithm::DatafrogOpt(Engine::Datafrog)) {
91+
let souffle_opt = Output::compute(all_facts, Algorithm::DatafrogOpt(Engine::Souffle), false);
92+
assert_equal(&opt.errors, &souffle_opt.errors);
93+
assert_equal(&opt.subset_errors, &souffle_opt.subset_errors);
94+
}
8595
}
8696

8797
// The hybrid algorithm gets the same errors as the naive version

0 commit comments

Comments
 (0)