From e46a99a0a01de0935ffc2ac144ad65de01c6a221 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 27 Dec 2018 11:46:31 -0500 Subject: [PATCH] extend tests to cover the insensitive analysis --- src/test.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test.rs b/src/test.rs index 5247bbe237e..a9d58ce438f 100644 --- a/src/test.rs +++ b/src/test.rs @@ -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);