Add CLI test for the example in #433

pull/502/head
Wilfred Hughes 2023-03-16 00:13:41 +07:00
parent b1ecf00602
commit 3e4df7d7dd
3 changed files with 37 additions and 0 deletions

@ -0,0 +1,24 @@
if (! window.Home) {
window.Home = new (class Home {
constructor() {
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
// random
}
})();
}

@ -96,3 +96,16 @@ fn list_languages() {
let predicate_fn = predicate::str::contains("*.toml");
cmd.assert().stdout(predicate_fn);
}
#[test]
fn test_mime_type_false_positive() {
use predicates::prelude::*;
let mut cmd = Command::cargo_bin("difft").unwrap();
cmd.arg("sample_files/cli_tests/x_mod_false_positive.js")
.arg("sample_files/cli_tests/empty.js");
let predicate_fn = predicate::str::contains("JavaScript");
cmd.assert().stdout(predicate_fn);
}