Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVeryDarkness committed Aug 11, 2024
1 parent eb7234f commit b1fa186
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/integers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ fn read_char_3() {
assert!(iof::ReadInto::<u32>::try_read_char(&mut reader).is_err());
}

#[test]
fn read_char_in_3_lines() {
let reader = Cursor::new("\n1\n2\n3".as_bytes());
let mut reader = InputStream::new(reader);

let a: u32 = reader.read_char();
assert_eq!(a, 1);

let b: u32 = reader.read_char();
assert_eq!(b, 2);

let c: u32 = reader.read_char();
assert_eq!(c, 3);

assert!(iof::ReadInto::<u32>::try_read_char(&mut reader).is_err());
}

#[test]
#[should_panic = "failed to read a non-whitespace character before EOF"]
fn read_char_empty() {
Expand Down

0 comments on commit b1fa186

Please sign in to comment.