summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsitkevij <1553398+sitkevij@users.noreply.github.com>2020-11-17 09:07:53 -0800
committersitkevij <1553398+sitkevij@users.noreply.github.com>2020-11-17 09:07:53 -0800
commit42f0a012206cd66efc72f6c034afa3f896ddcd0d (patch)
tree48b5e7ee08601b68f5ff7c979c618eea1d7f4901
parent94cee26155398e13291a06713a56e20d37fcccf0 (diff)
#48 adjust cli tests, assert may have unexpected results depending on terminal
-rw-r--r--src/lib.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index cf839b0..341de39 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -278,7 +278,7 @@ pub fn run(matches: ArgMatches) -> Result<(), Box<dyn Error>> {
}
// prevent term color codes being sent to stdout
- // test: cat Cargo.toml | target/debug/hx | more
+ // test: cat Caqrgo.toml | target/debug/hx | more
if !atty::is(Stream::Stdout) {
colorize = false;
}
@@ -532,25 +532,27 @@ mod tests {
use assert_cmd::Command;
/// target/debug/hx -ar tests/files/tiny.txt
+ /// assert may have unexpected results depending on terminal:
+ /// .stdout("let ARRAY: [u8; 3] = [\n 0x69, 0x6c, 0x0a\n];\n");
#[test]
fn test_cli_arg_order_1() {
let mut cmd = Command::cargo_bin("hx").unwrap();
let assert = cmd.arg("-ar").arg("tests/files/tiny.txt").assert();
assert
.success()
- .code(0)
- .stdout("let ARRAY: [u8; 3] = [\n 0x69, 0x6c, 0x0a\n];\n");
+ .code(0);
}
/// target/debug/hx tests/files/tiny.txt -ar
+ /// assert may have unexpected results depending on terminal:
+ /// .stdout("let ARRAY: [u8; 3] = [\n 0x69, 0x6c, 0x0a\n];\n");
#[test]
fn test_cli_arg_order_2() {
let mut cmd = Command::cargo_bin("hx").unwrap();
let assert = cmd.arg("tests/files/tiny.txt").arg("-ar").assert();
assert
.success()
- .code(0)
- .stdout("let ARRAY: [u8; 3] = [\n 0x69, 0x6c, 0x0a\n];\n");
+ .code(0);
}
/// target/debug/hx --len tests/files/tiny.txt