about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2013-10-01 18:02:11 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2013-10-01 18:02:11 +0200
commit06f46902caf4a98132229237820d482f99e147ea (patch)
treeed6306dd7d1eb8218b060d8245c19b54ca213dcc
parent155857f5488f2b6ca04c3abe6ac22833028c1497 (diff)
fix tests for check-fast.
-rw-r--r--src/test/compile-fail/match-static-const-lc.rs17
-rw-r--r--src/test/run-pass/match-static-const-rename.rs6
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 4e9203496de..1cdceaca6b4 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 3da4e0505bb..b1c0525e95c 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);