From 195d8fdc4f7892a4a5755f96c0ca1e993ce74943 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 10 Feb 2014 22:37:14 +0100 Subject: [PATCH] Reenable some ignored test cases * src/test/run-pass/issue-3559.rs was fixed in #4726 * src/test/compile-fail/borrowck-call-sendfn.rs was fixed in #2978 * update src/test/compile-fail/issue-5500-1.rs to work with current Rust * removed src/test/compile-fail/issue-5500.rs because it is tested in src/test/run-fail/issue-5500.rs * src/test/compile-fail/view-items-at-top.rs fixed * #897 fixed * compile-fail/issue-6762.rs issue was closed as dup of #6801 * deleted compile-fail/issue-2074.rs because it became irelevant and is irrelevant #2074, a test covering this was added in 4f92f452bd701fb39156d66d4756cc48cc396a8a --- src/test/compile-fail/borrowck-call-sendfn.rs | 7 ++--- src/test/compile-fail/issue-5500-1.rs | 8 +++--- src/test/compile-fail/issue-5500.rs | 13 --------- .../{issue-6762.rs => issue-6801.rs} | 0 src/test/compile-fail/issue-897-2.rs | 19 +++---------- src/test/compile-fail/issue-897.rs | 8 +++--- src/test/compile-fail/view-items-at-top.rs | 2 -- .../{addr-of-bot.rs => issue-5500.rs} | 0 src/test/run-pass/issue-3559.rs | 27 +++++++------------ 9 files changed, 23 insertions(+), 61 deletions(-) delete mode 100644 src/test/compile-fail/issue-5500.rs rename src/test/compile-fail/{issue-6762.rs => issue-6801.rs} (100%) rename src/test/run-fail/{addr-of-bot.rs => issue-5500.rs} (100%) diff --git a/src/test/compile-fail/borrowck-call-sendfn.rs b/src/test/compile-fail/borrowck-call-sendfn.rs index 00e8a12d5729d..57c0deb178d5a 100644 --- a/src/test/compile-fail/borrowck-call-sendfn.rs +++ b/src/test/compile-fail/borrowck-call-sendfn.rs @@ -8,15 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test #2978 - struct Foo { f: proc() } -fn call(x: @Foo) { - x.f(); //~ ERROR foo - //~^ NOTE bar +fn call(x: Foo) { + x.f(); //~ ERROR does not implement any method in scope named `f` } fn main() {} diff --git a/src/test/compile-fail/issue-5500-1.rs b/src/test/compile-fail/issue-5500-1.rs index 42812e5559c45..e1779a1db8697 100644 --- a/src/test/compile-fail/issue-5500-1.rs +++ b/src/test/compile-fail/issue-5500-1.rs @@ -8,15 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test - struct TrieMapIterator<'a> { - priv node: &'a uint + node: &'a uint } fn main() { let a = 5; - let _iter = TrieMapIterator{node: &a}; //~ ERROR bad - _iter.node = & + let _iter = TrieMapIterator{node: &a}; + _iter.node = & //~ ERROR cannot assign to immutable field fail!() } diff --git a/src/test/compile-fail/issue-5500.rs b/src/test/compile-fail/issue-5500.rs deleted file mode 100644 index c778e750e3a72..0000000000000 --- a/src/test/compile-fail/issue-5500.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-test - -fn main() { &fail!() } //~ ERROR bad diff --git a/src/test/compile-fail/issue-6762.rs b/src/test/compile-fail/issue-6801.rs similarity index 100% rename from src/test/compile-fail/issue-6762.rs rename to src/test/compile-fail/issue-6801.rs diff --git a/src/test/compile-fail/issue-897-2.rs b/src/test/compile-fail/issue-897-2.rs index f2fffffb3dc54..91d47cae15cfe 100644 --- a/src/test/compile-fail/issue-897-2.rs +++ b/src/test/compile-fail/issue-897-2.rs @@ -1,18 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ignore-test -// ignored because the lint pass doesn't know to ignore standard library -// stuff. - -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -29,4 +15,5 @@ fn f() -> ! { return g(); g(); //~ ERROR: unreachable statement } -fn main() { } + +fn main() { f() } diff --git a/src/test/compile-fail/issue-897.rs b/src/test/compile-fail/issue-897.rs index 7befa16c23829..18e25de3eaeb2 100644 --- a/src/test/compile-fail/issue-897.rs +++ b/src/test/compile-fail/issue-897.rs @@ -8,12 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test +// error-pattern: unreachable statement #[deny(unreachable_code)]; fn f() -> ! { return fail!(); - fail!(); //~ ERROR: unreachable statement + fail!(); // the unreachable statement error is in , at this line, there + // only is a note } -fn main() { } + +fn main() { f() } diff --git a/src/test/compile-fail/view-items-at-top.rs b/src/test/compile-fail/view-items-at-top.rs index 9614c1f037ea5..c7c96809eecb3 100644 --- a/src/test/compile-fail/view-items-at-top.rs +++ b/src/test/compile-fail/view-items-at-top.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test - extern mod extra; fn f() { diff --git a/src/test/run-fail/addr-of-bot.rs b/src/test/run-fail/issue-5500.rs similarity index 100% rename from src/test/run-fail/addr-of-bot.rs rename to src/test/run-fail/issue-5500.rs diff --git a/src/test/run-pass/issue-3559.rs b/src/test/run-pass/issue-3559.rs index 8da800c98b8da..5cc098e591cfe 100644 --- a/src/test/run-pass/issue-3559.rs +++ b/src/test/run-pass/issue-3559.rs @@ -8,27 +8,20 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test #4276 +use std::hashmap::HashMap; -// rustc --test map_to_str.rs && ./map_to_str -extern mod extra; - -fn check_strs(actual: &str, expected: &str) -> bool -{ - if actual != expected - { - println!("Found %s, but expected %s", actual, expected); +fn check_strs(actual: &str, expected: &str) -> bool { + if actual != expected { + println!("Found {}, but expected {}", actual, expected); return false; } return true; } -fn tester() -{ - let mut table = std::hashmap::HashMap::new(); - table.insert(@~"one", 1); - table.insert(@~"two", 2); - assert!(check_strs(table.to_str(), ~"xxx")); // not sure what expected should be +pub fn main() { + let mut table = HashMap::new(); + table.insert(~"one", 1); + table.insert(~"two", 2); + assert!(check_strs(table.to_str(), "{one: 1, two: 2}") || + check_strs(table.to_str(), "{two: 2, one: 1}")); } - -pub fn main() {}