Skip to content

Commit 06c3716

Browse files
committed
Fixed all use sites and tests
1 parent c99488b commit 06c3716

File tree

13 files changed

+204
-176
lines changed

13 files changed

+204
-176
lines changed

src/compiletest/header.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ fn parse_check_line(line: ~str) -> Option<~str> {
142142
fn parse_exec_env(line: ~str) -> Option<(~str, ~str)> {
143143
do parse_name_value_directive(line, ~"exec-env").map |nv| {
144144
// nv is either FOO or FOO=BAR
145-
let strs = str::splitn_char(*nv, '=', 1u);
145+
let mut strs = ~[];
146+
for str::each_splitn_char(*nv, '=', 1u) |s| { strs.push(s.to_owned()); }
146147
match strs.len() {
147148
1u => (strs[0], ~""),
148149
2u => (strs[0], strs[1]),

src/compiletest/runtest.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ fn run_debuginfo_test(config: config, props: TestProps, testfile: &Path) {
267267
// check if each line in props.check_lines appears in the
268268
// output (in order)
269269
let mut i = 0u;
270-
for str::lines_each(ProcRes.stdout) |line| {
270+
for str::each_line(ProcRes.stdout) |line| {
271271
if props.check_lines[i].trim() == line.trim() {
272272
i += 1u;
273273
}
@@ -297,7 +297,7 @@ fn check_error_patterns(props: TestProps,
297297
let mut next_err_idx = 0u;
298298
let mut next_err_pat = props.error_patterns[next_err_idx];
299299
let mut done = false;
300-
for str::lines_each(ProcRes.stderr) |line| {
300+
for str::each_line(ProcRes.stderr) |line| {
301301
if str::contains(line, next_err_pat) {
302302
debug!("found error pattern %s", next_err_pat);
303303
next_err_idx += 1u;
@@ -347,7 +347,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
347347
// filename:line1:col1: line2:col2: *warning:* msg
348348
// where line1:col1: is the starting point, line2:col2:
349349
// is the ending point, and * represents ANSI color codes.
350-
for str::lines_each(ProcRes.stderr) |line| {
350+
for str::each_line(ProcRes.stderr) |line| {
351351
let mut was_expected = false;
352352
for vec::eachi(expected_errors) |i, ee| {
353353
if !found_flags[i] {
@@ -596,8 +596,12 @@ fn split_maybe_args(argstr: Option<~str>) -> ~[~str] {
596596
}
597597

598598
match argstr {
599-
Some(s) => rm_whitespace(str::split_char(s, ' ')),
600-
None => ~[]
599+
Some(s) => {
600+
let mut ss = ~[];
601+
for str::each_split_char(s, ' ') |s| { ss.push(s.to_owned()) }
602+
rm_whitespace(ss)
603+
}
604+
None => ~[]
601605
}
602606
}
603607

0 commit comments

Comments
 (0)