Skip to content

Commit fea1380

Browse files
committedApr 3, 2013
libstd: make fileinput tests pass.
1 parent 1e28d8f commit fea1380

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/libstd/fileinput.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ mod test {
461461
}
462462
463463
assert_eq!(fi.read_byte(), -1);
464-
fail_unless!(fi.eof());
464+
assert!(fi.eof());
465465
assert_eq!(fi.state().line_num, 3)
466466
467467
}
@@ -482,7 +482,7 @@ mod test {
482482
let count = fi.read(buf, 10);
483483
assert_eq!(count, 6);
484484
assert_eq!(buf, "0\n1\n2\n".to_bytes());
485-
fail_unless!(fi.eof())
485+
assert!(fi.eof())
486486
assert_eq!(fi.state().line_num, 3);
487487
}
488488

@@ -520,7 +520,9 @@ mod test {
520520
}
521521

522522
for input_vec_state(filenames) |line, state| {
523-
let nums = str::split_char(line, ' ');
523+
let nums = do vec::build |p| {
524+
for str::each_split_char(line, ' ') |s| { p(s.to_owned()); }
525+
};
524526
let file_num = uint::from_str(nums[0]).get();
525527
let line_num = uint::from_str(nums[1]).get();
526528
assert_eq!(line_num, state.line_num_file);

5 commit comments

Comments
 (5)

bors commented on Apr 3, 2013

@bors
Collaborator

bors commented on Apr 3, 2013

@bors
Collaborator

merging dbaupp/rust/std-fileinput = fea1380 into auto

bors commented on Apr 3, 2013

@bors
Collaborator

dbaupp/rust/std-fileinput = fea1380 merged ok, testing candidate = 0cc9030

bors commented on Apr 3, 2013

@bors
Collaborator

fast-forwarding incoming to auto = 0cc9030

Please sign in to comment.