Skip to content

Commit

Permalink
Reenable some ignored test cases
Browse files Browse the repository at this point in the history
* 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
  4f92f45
  • Loading branch information
fhahn committed Feb 12, 2014
1 parent be3cbcb commit 195d8fd
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 61 deletions.
7 changes: 2 additions & 5 deletions src/test/compile-fail/borrowck-call-sendfn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
8 changes: 3 additions & 5 deletions src/test/compile-fail/issue-5500-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
}
13 changes: 0 additions & 13 deletions src/test/compile-fail/issue-5500.rs

This file was deleted.

File renamed without changes.
19 changes: 3 additions & 16 deletions src/test/compile-fail/issue-897-2.rs
Original file line number Diff line number Diff line change
@@ -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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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.
//
Expand All @@ -29,4 +15,5 @@ fn f() -> ! {
return g();
g(); //~ ERROR: unreachable statement
}
fn main() { }

fn main() { f() }
8 changes: 5 additions & 3 deletions src/test/compile-fail/issue-897.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <std macro>, at this line, there
// only is a note
}
fn main() { }

fn main() { f() }
2 changes: 0 additions & 2 deletions src/test/compile-fail/view-items-at-top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
File renamed without changes.
27 changes: 10 additions & 17 deletions src/test/run-pass/issue-3559.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

5 comments on commit 195d8fd

@bors
Copy link
Contributor

@bors bors commented on 195d8fd Feb 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at fhahn@195d8fd

@bors
Copy link
Contributor

@bors bors commented on 195d8fd Feb 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging fhahn/rust/change-some-tests = 195d8fd into auto

@bors
Copy link
Contributor

@bors bors commented on 195d8fd Feb 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fhahn/rust/change-some-tests = 195d8fd merged ok, testing candidate = 58eeb07

@bors
Copy link
Contributor

@bors bors commented on 195d8fd Feb 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 195d8fd Feb 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 58eeb07

Please sign in to comment.