diff options
| author | Andrew Dunham <andrew@du.nham.ca> | 2014-08-30 23:48:31 -0700 |
|---|---|---|
| committer | Andrew Dunham <andrew@du.nham.ca> | 2014-08-30 23:48:31 -0700 |
| commit | 5bb61963787f3e6e67890595287e1d862a432c07 (patch) | |
| tree | a7fff4daf06f9b853b2bc7989d51c92ac223735a | |
| parent | 1c49eaaa55091f0cca2e6266b35b36e8c6acf2a6 (diff) | |
| download | rust-5bb61963787f3e6e67890595287e1d862a432c07.tar.gz rust-5bb61963787f3e6e67890595287e1d862a432c07.zip | |
Address review comments, add tests
| -rw-r--r-- | src/librustc/front/test.rs | 3 | ||||
| -rw-r--r-- | src/test/run-pass/issue-16597-empty.rs | 14 | ||||
| -rw-r--r-- | src/test/run-pass/issue-16597.rs | 20 |
3 files changed, 35 insertions, 2 deletions
diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs index 8bcbe011366..13f6243fb7b 100644 --- a/src/librustc/front/test.rs +++ b/src/librustc/front/test.rs @@ -545,8 +545,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> Gc<ast::Expr> { let mut visible_path = match cx.toplevel_reexport { Some(id) => vec![id], None => { - cx.sess.span_bug( - DUMMY_SP, + cx.sess.bug( "expected to find top-level re-export name, but found None" ); } diff --git a/src/test/run-pass/issue-16597-empty.rs b/src/test/run-pass/issue-16597-empty.rs new file mode 100644 index 00000000000..c51e33c0104 --- /dev/null +++ b/src/test/run-pass/issue-16597-empty.rs @@ -0,0 +1,14 @@ +// 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. + +// compile-flags:--test + +// This verifies that the test generation doesn't crash when we have +// no tests - for more information, see PR #16892. diff --git a/src/test/run-pass/issue-16597.rs b/src/test/run-pass/issue-16597.rs new file mode 100644 index 00000000000..fafdd8ac938 --- /dev/null +++ b/src/test/run-pass/issue-16597.rs @@ -0,0 +1,20 @@ +// 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. + +// compile-flags:--test + +#![feature(globs)] + +mod test { + use super::*; + + #[test] + fn test(){} +} |
