diff --git a/src/test.rs b/src/test.rs index a9d58ce438f..83829cf474c 100644 --- a/src/test.rs +++ b/src/test.rs @@ -16,8 +16,29 @@ fn test_facts(all_facts: &AllFacts, algorithms: &[Algorithm]) { // 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); + for (naive_point, naive_loans) in &naive.errors { + match insensitive.errors.get(&naive_point) { + Some(insensitive_loans) => { + for naive_loan in naive_loans { + if !insensitive_loans.contains(naive_loan) { + panic!( + "naive analysis had error for `{:?}` at `{:?}` \ + but insensitive analysis did not \ + (loans = {:#?})", + naive_point, naive_loan, insensitive_loans, + ); + } + } + } + + None => { + panic!( + "naive analysis had errors at `{:?}` but insensitive analysis did not \ + (loans = {:#?})", + naive_point, naive_loans, + ); + } + } } // The optimized checks should behave exactly the same as the naive check.