1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

test(arch): Add some tests

This commit is contained in:
Sylvestre Ledru 2020-05-05 23:08:58 +02:00 committed by Sylvestre Ledru
parent a93d007cde
commit 16bf4b1893
3 changed files with 20 additions and 1 deletions

View file

@ -15,7 +15,7 @@ extern crate uucore;
use platform_info::*;
static SYNTAX: &str = "";
static SYNTAX: &str = "Print machine architecture";
static SUMMARY: &str = "Determine architecture name for current machine.";
static LONG_HELP: &str = "";

18
tests/test_arch.rs Normal file
View file

@ -0,0 +1,18 @@
use common::util::*;
#[test]
fn test_arch() {
let (_, mut ucmd) = at_and_ucmd!();
let result = ucmd.run();
assert!(result.success);
}
#[test]
fn test_arch_help() {
let (_, mut ucmd) = at_and_ucmd!();
let result = ucmd.arg("--help").run();
assert!(result.success);
assert!(result.stdout.contains("architecture name"));
}

View file

@ -46,6 +46,7 @@ macro_rules! generic {
};
}
generic! {
"arch", test_arch;
"base32", test_base32;
"base64", test_base64;
"basename", test_basename;