From a22a3300e3b696ff935ba4f8d8c325d76f301991 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 21 Aug 2024 05:37:43 -0400 Subject: [PATCH] `tests`: add `--version` test --- tests/test_count.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_count.rs b/tests/test_count.rs index 2620b2535..10775cd66 100644 --- a/tests/test_count.rs +++ b/tests/test_count.rs @@ -325,3 +325,14 @@ fn prop_count_noheaders_indexed_env() { } qcheck(p as fn(CsvData) -> bool); } + +#[test] +fn show_version() { + let wrk = Workdir::new("show_version"); + let mut cmd = wrk.command(""); + cmd.arg("--version"); + + let got: String = wrk.stdout(&mut cmd); + let expected = format!(" {}", env!("CARGO_PKG_VERSION")); + assert!(got.contains(&expected)); +}