From 4ee3e9e563075299919231e66e18fbfd093659d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Rigo?= Date: Fri, 19 Jan 2024 11:59:59 +0100 Subject: [PATCH] Test verbose mode in tsdec --- src/timeapp.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/timeapp.rs b/src/timeapp.rs index ce6de0c..7cd8371 100644 --- a/src/timeapp.rs +++ b/src/timeapp.rs @@ -152,6 +152,19 @@ mod tests { String::from_utf8(app.process_test(ts.as_bytes().to_vec())).unwrap() } + #[test] + fn test_verbose_cli_stdin() { + assert_cmd::Command::cargo_bin("rsbkb") + .expect("Could not run binary") + .args(&["tsdec", "-v"]) + .write_stdin("1") + .assert() + .stdout("1970-01-01T00:00:01Z") + .stderr("Used format: Seconds since Epoch\n") + .success(); + } + + #[test] fn test_decimal() { let ts = TimeApplet {