From ee8a08bfa24d9a3d09273fdebe8d73ac38c545f9 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Sat, 6 Sep 2025 09:30:39 +0200 Subject: Update guessing game Signed-off-by: Carlos Maiolino --- rust/hello/tests/.cli.rs.un~ | Bin 0 -> 1045 bytes rust/hello/tests/cli.rs | 19 +++++++++++++++++++ rust/hello/tests/cli.rs~ | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 rust/hello/tests/.cli.rs.un~ create mode 100644 rust/hello/tests/cli.rs create mode 100644 rust/hello/tests/cli.rs~ (limited to 'rust/hello/tests') diff --git a/rust/hello/tests/.cli.rs.un~ b/rust/hello/tests/.cli.rs.un~ new file mode 100644 index 0000000..9dee229 Binary files /dev/null and b/rust/hello/tests/.cli.rs.un~ differ diff --git a/rust/hello/tests/cli.rs b/rust/hello/tests/cli.rs new file mode 100644 index 0000000..a69010f --- /dev/null +++ b/rust/hello/tests/cli.rs @@ -0,0 +1,19 @@ +use assert_cmd::Command; + +#[test] +fn runs() { + let mut cmd = Command::cargo_bin("hello").unwrap(); + cmd.assert().success().stdout("Hello, world!\n"); +} + +#[test] +fn true_ok() { + let mut cmd = Command::cargo_bin("true").unwrap(); + cmd.assert().success(); +} + +#[test] +fn false_not_ok() { + let mut cmd = Command::cargo_bin("false").unwrap(); + cmd.assert().failure(); +} diff --git a/rust/hello/tests/cli.rs~ b/rust/hello/tests/cli.rs~ new file mode 100644 index 0000000..57bbfdf --- /dev/null +++ b/rust/hello/tests/cli.rs~ @@ -0,0 +1,19 @@ +use assert_cmd::Command; + +#[test] +fn runs() { + let mut cmd = Command::cargo_bin("hello").unwrap(); + cmd.assert().success().stdout("Hello, world!!\n"); +} + +#[test] +fn true_ok() { + let mut cmd = Command::cargo_bin("true").unwrap(); + cmd.assert().success(); +} + +#[test] +fn false_not_ok() { + let mut cmd = Command::cargo_bin("false").unwrap(); + cmd.assert().failure(); +} -- cgit v1.2.3