Skip to content

Commit

Permalink
test: Add test for invalid UTF-8 input
Browse files Browse the repository at this point in the history
Not sure what this is supposed to test though...
but it at least documents an example of what's considered invalid input
  • Loading branch information
alexpovel committed May 29, 2023
1 parent b2fcf33 commit 8a93f60
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,14 @@ fn test_cli(samples: Vec<Sample>, #[values(&["german"], &["symbols"])] args: &[&
})
}
}

#[test]
#[should_panic]
fn test_cli_on_invalid_utf8() {
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();

let input = b"invalid utf8 \xFF";
cmd.arg("german").write_stdin(*input);

cmd.assert().success();
}

0 comments on commit 8a93f60

Please sign in to comment.