From 4c1774e918f41b71a44532535afc81bbe246580d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 1 May 2020 00:24:06 +0200 Subject: [PATCH] test(uname): Add uname tests --- GNUmakefile | 1 + tests/test_uname.rs | 17 +++++++++++++++++ tests/tests.rs | 1 + 3 files changed, 19 insertions(+) create mode 100644 tests/test_uname.rs diff --git a/GNUmakefile b/GNUmakefile index a0c817289..64ceaa5c2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -205,6 +205,7 @@ TEST_PROGS := \ true \ truncate \ tsort \ + uname \ unexpand \ uniq \ unlink \ diff --git a/tests/test_uname.rs b/tests/test_uname.rs new file mode 100644 index 000000000..b9504b7fc --- /dev/null +++ b/tests/test_uname.rs @@ -0,0 +1,17 @@ +use common::util::*; + +#[test] +fn test_uname_compatible() { + let (_, mut ucmd) = at_and_ucmd!(); + + let result = ucmd.arg("-a").run(); + assert!(result.success); +} + +#[test] +fn test_uname_name() { + let (_, mut ucmd) = at_and_ucmd!(); + + let result = ucmd.arg("-n").run(); + assert!(result.success); +} diff --git a/tests/tests.rs b/tests/tests.rs index 82c681608..4546af1d0 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -29,6 +29,7 @@ unix_only! { "pathchk", test_pathchk; "pinky", test_pinky; "stdbuf", test_stdbuf; + "uname", test_uname; "unlink", test_unlink; "who", test_who; // Be aware of the trailing semicolon after the last item