1
Fork 0
romantic/tests/errors.rs

15 lines
347 B
Rust
Raw Normal View History

2022-04-10 14:11:14 +00:00
use romantic::Roman;
use test_case::test_case;
#[test_case("A"; "invalid character")]
fn test_from_str_error(input: &str) {
assert!(Roman::default().from_str::<i32>(input).is_err());
}
#[test_case(4000; "too high")]
#[test_case(-100; "negative")]
fn test_to_string_error(input: i32) {
assert!(Roman::default().to_string(input).is_err());
}