Skip to content

Commit

Permalink
extend tests to cover the insensitive analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Dec 28, 2018
1 parent 6480c5c commit e46a99a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ use std::path::Path;

fn test_facts(all_facts: &AllFacts, algorithms: &[Algorithm]) {
let naive = Output::compute(all_facts, Algorithm::Naive, true);

// If the insensitive analysis concludes no errors, then naive
// should also.
let insensitive = Output::compute(all_facts, Algorithm::LocationInsensitive, false);
if insensitive.errors.is_empty() {
assert_equal(&naive.errors, &insensitive.errors);
}

// The optimized checks should behave exactly the same as the naive check.
for &optimized_algorithm in algorithms {
println!("Algorithm {:?}", optimized_algorithm);
let opt = Output::compute(all_facts, optimized_algorithm, true);
Expand Down

0 comments on commit e46a99a

Please sign in to comment.