From 48921ce30095bcc356f2fe082e29edb004d1eda9 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge <jsgf@fb.com> Date: Thu, 10 Jun 2021 14:01:21 -0700 Subject: [PATCH] Implement assert_non_crate_hash_different for tests --- compiler/rustc_interface/src/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 865c281be9c..c210865a4ad 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -96,6 +96,14 @@ fn assert_different_hash(x: &Options, y: &Options) { assert_same_clone(y); } +fn assert_non_crate_hash_different(x: &Options, y: &Options) { + assert_eq!(x.dep_tracking_hash(true), y.dep_tracking_hash(true)); + assert_ne!(x.dep_tracking_hash(false), y.dep_tracking_hash(false)); + // Check clone + assert_same_clone(x); + assert_same_clone(y); +} + // When the user supplies --test we should implicitly supply --cfg test #[test] fn test_switch_implies_cfg_test() {