Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVeryDarkness committed Sep 4, 2024
1 parent 00888d5 commit 3389c65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ fn show() {
show!(((1, 2), (3, 4)));
show!(());
show!((1, 2, 3), (4, 5, 6), (7, 8, 9));
let mut buf = Vec::new();
show!((1, 2, 3), (4, 5, 6), (7, 8, 9); buf = &mut buf);
assert_eq!(String::from_utf8(buf).unwrap(), "1 2 3 4 5 6 7 8 9\n");
}
9 changes: 9 additions & 0 deletions tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ fn read_n_from_str_err() {
let _: Vec<u32> = reader.read_n(3);
}

#[test]
#[should_panic = "invalid digit found in string"]
fn read_from_str_err() {
let reader = Cursor::new("1 -2 -3".as_bytes());
let mut reader = InputStream::new(reader);

let _: Vec<u32> = reader.read();
}

#[test]
fn read_char_3() {
let reader = Cursor::new("1 2 3".as_bytes());
Expand Down

0 comments on commit 3389c65

Please sign in to comment.