diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-09-19 16:55:01 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-09-19 17:03:01 -0700 |
| commit | cfed923600e2f7ad34241501200d595abccdeb54 (patch) | |
| tree | d382eb144026703d9abee0e6a99b87b34e9bd138 /src/compiletest | |
| parent | 1c39f1968c77a3d42b0fdb30a36cff4d94a17da2 (diff) | |
| download | rust-cfed923600e2f7ad34241501200d595abccdeb54.tar.gz rust-cfed923600e2f7ad34241501200d595abccdeb54.zip | |
demode the each() method on vec and other iterables.
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/compiletest.rs | 6 | ||||
| -rw-r--r-- | src/compiletest/runtest.rs | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 02c933b6fa3..869f3e93395 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -138,7 +138,7 @@ fn make_tests(config: config) -> ~[test::TestDesc] { config.src_base.to_str()); let mut tests = ~[]; for os::list_dir_path(&config.src_base).each |file| { - let file = copy file; + let file = copy *file; debug!("inspecting file %s", file.to_str()); if is_test(config, file) { vec::push(tests, make_test(config, file)) @@ -160,11 +160,11 @@ fn is_test(config: config, testfile: &Path) -> bool { let mut valid = false; for valid_extensions.each |ext| { - if str::ends_with(name, ext) { valid = true; } + if str::ends_with(name, *ext) { valid = true; } } for invalid_prefixes.each |pre| { - if str::starts_with(name, pre) { valid = false; } + if str::starts_with(name, *pre) { valid = false; } } return valid; diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index cae9801b674..a6437598acf 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -219,7 +219,7 @@ fn check_error_patterns(props: test_props, let mut next_err_pat = props.error_patterns[next_err_idx]; let mut done = false; for str::split_char(procres.stderr, '\n').each |line| { - if str::contains(line, next_err_pat) { + if str::contains(*line, next_err_pat) { debug!("found error pattern %s", next_err_pat); next_err_idx += 1u; if next_err_idx == vec::len(props.error_patterns) { @@ -240,7 +240,7 @@ fn check_error_patterns(props: test_props, missing_patterns[0]), procres); } else { for missing_patterns.each |pattern| { - error(fmt!("error pattern '%s' not found!", pattern)); + error(fmt!("error pattern '%s' not found!", *pattern)); } fatal_procres(~"multiple error patterns not found", procres); } @@ -273,10 +273,10 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error], for vec::eachi(expected_errors) |i, ee| { if !found_flags[i] { debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s", - prefixes[i], ee.kind, ee.msg, line); - if (str::starts_with(line, prefixes[i]) && - str::contains(line, ee.kind) && - str::contains(line, ee.msg)) { + prefixes[i], ee.kind, ee.msg, *line); + if (str::starts_with(*line, prefixes[i]) && + str::contains(*line, ee.kind) && + str::contains(*line, ee.msg)) { found_flags[i] = true; was_expected = true; break; @@ -285,13 +285,13 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error], } // ignore this msg which gets printed at the end - if str::contains(line, ~"aborting due to") { + if str::contains(*line, ~"aborting due to") { was_expected = true; } - if !was_expected && is_compiler_error_or_warning(line) { + if !was_expected && is_compiler_error_or_warning(*line) { fatal_procres(fmt!("unexpected compiler error or warning: '%s'", - line), + *line), procres); } } |
