diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-11-07 13:41:02 -0800 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-11-13 08:57:31 -0800 |
| commit | 4e1ce014c831974738af62dce4fd699c20a001ff (patch) | |
| tree | 51678479fe275880834402c07a1418b1d0ea0d15 /src/test | |
| parent | 2b93ab5a210066abab30e46e54e999fadbcf5e70 (diff) | |
| download | rust-4e1ce014c831974738af62dce4fd699c20a001ff.tar.gz rust-4e1ce014c831974738af62dce4fd699c20a001ff.zip | |
cleanup: convert some remaining #foo invocations to foo! form.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/bench/core-std.rs | 10 | ||||
| -rw-r--r-- | src/test/bench/msgsend-ring-pipes.rs | 9 | ||||
| -rw-r--r-- | src/test/bench/shootout-k-nucleotide-pipes.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/shootout-k-nucleotide.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-2823.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/issue-2904.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/macro-2.rs | 7 | ||||
| -rw-r--r-- | src/test/run-pass/syntax-extension-shell.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/syntax-extension-source-utils.rs | 2 |
9 files changed, 14 insertions, 26 deletions
diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 6f90a2c99e8..3cc1163eb22 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -8,14 +8,12 @@ use std::map::{Map, HashMap}; use io::{Reader, ReaderUtil}; +macro_rules! bench ( + ($id:ident) => (maybe_run_test(argv, stringify!($id), $id)) +) + fn main() { let argv = os::args(); - #macro[ - [#bench[id], - maybe_run_test(argv, #stringify(id), id) - ] - ]; - let tests = vec::view(argv, 1, argv.len()); bench!(shift_push); diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index 636fef53732..da49b006cd9 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -18,12 +18,9 @@ proto! ring ( } ) -fn macros() { - #macro[ - [#move_out[x], - unsafe { let y = move *ptr::addr_of(&x); move y }] - ]; -} +macro_rules! move_out ( + ($x:expr) => { unsafe { let y = move *ptr::addr_of(&$x); move y } } +) fn thread_ring(i: uint, count: uint, diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 3a3c609853b..c395ff39430 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -132,7 +132,7 @@ fn main() { let args = os::args(); let rdr = if os::getenv(~"RUST_BENCH").is_some() { // FIXME: Using this compile-time env variable is a crummy way to - // get to this massive data set, but #include_bin chokes on it (#2598) + // get to this massive data set, but include_bin! chokes on it (#2598) let path = Path(env!("CFG_SRC_DIR")) .push_rel(&Path("src/test/bench/shootout-k-nucleotide.data")); result::get(&io::file_reader(&path)) diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index e4373d55c17..a4ff9ef1640 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -129,7 +129,7 @@ fn main() { let args = os::args(); let rdr = if os::getenv(~"RUST_BENCH").is_some() { // FIXME: Using this compile-time env variable is a crummy way to - // get to this massive data set, but #include_bin chokes on it (#2598) + // get to this massive data set, but include_bin! chokes on it (#2598) let path = Path(env!("CFG_SRC_DIR")) .push_rel(&Path("src/test/bench/shootout-k-nucleotide.data")); result::get(&io::file_reader(&path)) diff --git a/src/test/compile-fail/issue-2823.rs b/src/test/compile-fail/issue-2823.rs index fd2c1758458..67e028dcd46 100644 --- a/src/test/compile-fail/issue-2823.rs +++ b/src/test/compile-fail/issue-2823.rs @@ -1,12 +1,12 @@ struct C { x: int, drop { - #error("dropping: %?", self.x); + error!("dropping: %?", self.x); } } fn main() { let c = C{ x: 2}; let d = copy c; //~ ERROR copying a noncopyable value - #error("%?", d.x); + error!("%?", d.x); } \ No newline at end of file diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 5cc39f4d683..132fd47636b 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -71,7 +71,7 @@ mod test { #[test] fn read_simple_board() { - let s = #include_str("./maps/contest1.map"); + let s = include_str!("./maps/contest1.map"); io::with_str_reader(s, read_board_grid) } } diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs index 31f6d60df23..595583d2cef 100644 --- a/src/test/run-pass/macro-2.rs +++ b/src/test/run-pass/macro-2.rs @@ -1,13 +1,6 @@ // xfail-pretty - token trees can't pretty print fn main() { - #macro[[#mylambda[x, body], - { - fn f(x: int) -> int { return body; } - f - }]]; - - assert (mylambda!(y, y * 2)(8) == 16); macro_rules! mylambda_tt( ($x:ident, $body:expr) => { diff --git a/src/test/run-pass/syntax-extension-shell.rs b/src/test/run-pass/syntax-extension-shell.rs index 6ec80db8d55..2507057c648 100644 --- a/src/test/run-pass/syntax-extension-shell.rs +++ b/src/test/run-pass/syntax-extension-shell.rs @@ -1,5 +1,5 @@ // xfail-test fn main() { - auto s = #shell { uname -a }; + let s = shell!( uname -a ); log(debug, s); } diff --git a/src/test/run-pass/syntax-extension-source-utils.rs b/src/test/run-pass/syntax-extension-source-utils.rs index 7afb74fa121..2a6b5d644f1 100644 --- a/src/test/run-pass/syntax-extension-source-utils.rs +++ b/src/test/run-pass/syntax-extension-source-utils.rs @@ -1,5 +1,5 @@ // This test is brittle! -// xfail-pretty - the pretty tests lose path information, breaking #include +// xfail-pretty - the pretty tests lose path information, breaking include! #[legacy_exports]; mod m1 { |
