Skip to content

Commit

Permalink
Fix compile errors in test
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia committed Nov 2, 2018
1 parent 40e4144 commit 59a0309
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/libstd/io/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,40 +1098,40 @@ mod tests {

writer.write(&[0, 1]).unwrap();
assert_eq!(writer.buffer(), []);
assert_eq!(writer.get_ref(), [0, 1]);
assert_eq!(*writer.get_ref(), [0, 1]);

writer.write(&[2]).unwrap();
assert_eq!(writer.buffer(), [2]);
assert_eq!(writer.get_ref(), [0, 1]);
assert_eq!(*writer.get_ref(), [0, 1]);

writer.write(&[3]).unwrap();
assert_eq!(writer.buffer(), [2, 3]);
assert_eq!(writer.get_ref(), [0, 1]);
assert_eq!(*writer.get_ref(), [0, 1]);

writer.flush().unwrap();
assert_eq!(writer.buffer(), []);
assert_eq!(writer.get_ref(), [0, 1, 2, 3]);
assert_eq!(*writer.get_ref(), [0, 1, 2, 3]);

writer.write(&[4]).unwrap();
writer.write(&[5]).unwrap();
assert_eq!(writer.buffer(), [4, 5]);
assert_eq!(writer.get_ref(), [0, 1, 2, 3]);
assert_eq!(*writer.get_ref(), [0, 1, 2, 3]);

writer.write(&[6]).unwrap();
assert_eq!(writer.buffer(), [6]);
assert_eq!(writer.get_ref(), [0, 1, 2, 3, 4, 5]);
assert_eq!(*writer.get_ref(), [0, 1, 2, 3, 4, 5]);

writer.write(&[7, 8]).unwrap();
assert_eq!(writer.buffer(), []);
assert_eq!(writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8]);
assert_eq!(*writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8]);

writer.write(&[9, 10, 11]).unwrap();
assert_eq!(writer.buffer(), []);
assert_eq!(writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
assert_eq!(*writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);

writer.flush().unwrap();
assert_eq!(writer.buffer(), []);
assert_eq!(writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
assert_eq!(*writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
}

#[test]
Expand Down

0 comments on commit 59a0309

Please sign in to comment.