Skip to content

Commit

Permalink
libstd: make fileinput tests pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed Apr 3, 2013
1 parent 1e28d8f commit fea1380
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libstd/fileinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ mod test {
}

assert_eq!(fi.read_byte(), -1);
fail_unless!(fi.eof());
assert!(fi.eof());
assert_eq!(fi.state().line_num, 3)

}
Expand All @@ -482,7 +482,7 @@ mod test {
let count = fi.read(buf, 10);
assert_eq!(count, 6);
assert_eq!(buf, "0\n1\n2\n".to_bytes());
fail_unless!(fi.eof())
assert!(fi.eof())
assert_eq!(fi.state().line_num, 3);
}

Expand Down Expand Up @@ -520,7 +520,9 @@ mod test {
}

for input_vec_state(filenames) |line, state| {
let nums = str::split_char(line, ' ');
let nums = do vec::build |p| {
for str::each_split_char(line, ' ') |s| { p(s.to_owned()); }
};
let file_num = uint::from_str(nums[0]).get();
let line_num = uint::from_str(nums[1]).get();
assert_eq!(line_num, state.line_num_file);
Expand Down

5 comments on commit fea1380

@bors
Copy link
Contributor

@bors bors commented on fea1380 Apr 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on fea1380 Apr 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors
Copy link
Contributor

@bors bors commented on fea1380 Apr 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors
Copy link
Contributor

@bors bors commented on fea1380 Apr 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on fea1380 Apr 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 0cc9030

Please sign in to comment.