diff --git a/tests/cli.rs b/tests/cli.rs index 4754bbbe..637f0c3d 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -138,14 +138,18 @@ Duebel } #[test] - #[should_panic] fn test_cli_on_invalid_utf8() { let mut cmd = get_cmd(); let input = b"invalid utf8 \xFF"; + + #[allow(invalid_from_utf8)] // Attribute didn't work on `assert` macro? + let check = std::str::from_utf8(input); + assert!(check.is_err(), "Input is valid UTF8, test is broken"); + cmd.write_stdin(*input); - cmd.assert().success(); + cmd.assert().failure(); } fn get_cmd() -> Command {