Test: Wrong character test
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -135,7 +135,16 @@ mod tests {
|
|||||||
#[should_panic(expected = "Input must have dimension of size 2x2")]
|
#[should_panic(expected = "Input must have dimension of size 2x2")]
|
||||||
fn test_parse_field_too_short_input() {
|
fn test_parse_field_too_short_input() {
|
||||||
let input = "1 2 3";
|
let input = "1 2 3";
|
||||||
let field_size = 2;
|
let field_size = 3;
|
||||||
|
|
||||||
|
let _ = parse_playfield(&input.to_string(), field_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[should_panic(expected = "Input must contain only digits followed by space")]
|
||||||
|
fn test_parse_field_wrong_character() {
|
||||||
|
let input = "1 2 3 0 0 0 3 2 a";
|
||||||
|
let field_size = 3;
|
||||||
|
|
||||||
let _ = parse_playfield(&input.to_string(), field_size);
|
let _ = parse_playfield(&input.to_string(), field_size);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user