@@ -267,7 +267,7 @@ fn run_debuginfo_test(config: config, props: TestProps, testfile: &Path) {
267
267
// check if each line in props.check_lines appears in the
268
268
// output (in order)
269
269
let mut i = 0 u;
270
- for str:: lines ( ProcRes . stdout) . each |line| {
270
+ for str:: lines_each ( ProcRes . stdout) |line| {
271
271
if props. check_lines [ i] . trim ( ) == line. trim ( ) {
272
272
i += 1 u;
273
273
}
@@ -297,8 +297,8 @@ fn check_error_patterns(props: TestProps,
297
297
let mut next_err_idx = 0 u;
298
298
let mut next_err_pat = props. error_patterns [ next_err_idx] ;
299
299
let mut done = false ;
300
- for str:: split_char ( ProcRes . stderr, '\n' ) . each |line| {
301
- if str:: contains ( * line, next_err_pat) {
300
+ for str:: lines_each ( ProcRes . stderr) |line| {
301
+ if str:: contains ( line, next_err_pat) {
302
302
debug ! ( "found error pattern %s" , next_err_pat) ;
303
303
next_err_idx += 1 u;
304
304
if next_err_idx == vec:: len ( props. error_patterns ) {
@@ -347,15 +347,15 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
347
347
// filename:line1:col1: line2:col2: *warning:* msg
348
348
// where line1:col1: is the starting point, line2:col2:
349
349
// is the ending point, and * represents ANSI color codes.
350
- for str:: split_char ( ProcRes . stderr, '\n' ) . each |line| {
350
+ for str:: lines_each ( ProcRes . stderr) |line| {
351
351
let mut was_expected = false ;
352
352
for vec:: eachi( expected_errors) |i, ee| {
353
353
if !found_flags[ i] {
354
354
debug ! ( "prefix=%s ee.kind=%s ee.msg=%s line=%s" ,
355
- prefixes[ i] , ee. kind, ee. msg, * line) ;
356
- if ( str:: starts_with ( * line, prefixes[ i] ) &&
357
- str:: contains ( * line, ee. kind ) &&
358
- str:: contains ( * line, ee. msg ) ) {
355
+ prefixes[ i] , ee. kind, ee. msg, line) ;
356
+ if ( str:: starts_with ( line, prefixes[ i] ) &&
357
+ str:: contains ( line, ee. kind ) &&
358
+ str:: contains ( line, ee. msg ) ) {
359
359
found_flags[ i] = true ;
360
360
was_expected = true ;
361
361
break ;
@@ -364,13 +364,13 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
364
364
}
365
365
366
366
// ignore this msg which gets printed at the end
367
- if str:: contains ( * line, ~"aborting due to") {
367
+ if str:: contains ( line, ~"aborting due to") {
368
368
was_expected = true ;
369
369
}
370
370
371
- if !was_expected && is_compiler_error_or_warning ( * line) {
371
+ if !was_expected && is_compiler_error_or_warning ( str :: from_slice ( line) ) {
372
372
fatal_ProcRes ( fmt ! ( "unexpected compiler error or warning: '%s'" ,
373
- * line) ,
373
+ line) ,
374
374
ProcRes ) ;
375
375
}
376
376
}
0 commit comments