add logos crate.
This commit is contained in:
27
tests/cli.rs
Normal file
27
tests/cli.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use assert_cmd::prelude::*; // Add methods on commands
|
||||
use predicates::prelude::*; // Used for writing assertions
|
||||
use std::process::Command; // Run programs
|
||||
|
||||
#[test]
|
||||
fn file_doesnt_exist() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut cmd = Command::cargo_bin("mox")?;
|
||||
|
||||
cmd.arg("scan").arg("--file").arg("test.moxy");
|
||||
cmd.assert()
|
||||
.failure()
|
||||
.stderr(predicate::str::contains("No such file or directory"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scan_file_succeeds() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut cmd = Command::cargo_bin("mox")?;
|
||||
|
||||
cmd.arg("scan").arg("--file").arg("test.mox");
|
||||
cmd.assert().success().stdout(predicate::str::contains(
|
||||
"1:0 TokenFalse \"no\"",
|
||||
));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user