From 06f46902caf4a98132229237820d482f99e147ea Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 1 Oct 2013 18:02:11 +0200 Subject: [PATCH] fix tests for check-fast. --- src/test/compile-fail/match-static-const-lc.rs | 17 ++++++++++++++++- src/test/run-pass/match-static-const-rename.rs | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/test/compile-fail/match-static-const-lc.rs b/src/test/compile-fail/match-static-const-lc.rs index 4e9203496de3..1cdceaca6b4b 100644 --- a/src/test/compile-fail/match-static-const-lc.rs +++ b/src/test/compile-fail/match-static-const-lc.rs @@ -28,7 +28,7 @@ mod m { } fn g() { - use m::aha; + use self::m::aha; let r = match (0,0) { (0, aha) => 0, //~^ ERROR static constant in pattern should be all caps @@ -37,7 +37,22 @@ fn g() { assert!(r == 1); } +mod n { + pub static OKAY : int = 8; +} + +fn h() { + use not_okay = self::n::OKAY; + let r = match (0,0) { + (0, not_okay) => 0, + //~^ ERROR static constant in pattern should be all caps + (x, y) => 1 + x + y, + }; + assert!(r == 1); +} + fn main () { f(); g(); + h(); } diff --git a/src/test/run-pass/match-static-const-rename.rs b/src/test/run-pass/match-static-const-rename.rs index 3da4e0505bb0..b1c0525e95c6 100644 --- a/src/test/run-pass/match-static-const-rename.rs +++ b/src/test/run-pass/match-static-const-rename.rs @@ -38,7 +38,7 @@ mod m { } fn g() { - use AHA = m::aha; + use AHA = self::m::aha; let r = match (0,0) { (0, AHA) => 0, (x, y) => 1 + x + y, @@ -53,12 +53,12 @@ fn g() { fn h() { let r = match (0,0) { - (0, m::aha) => 0, + (0, self::m::aha) => 0, (x, y) => 1 + x + y, }; assert!(r == 1); let r = match (0,7) { - (0, m::aha) => 0, + (0, self::m::aha) => 0, (x, y) => 1 + x + y, }; assert!(r == 0);