test: add hex
flag test for lscpu
This commit is contained in:
@ -16,7 +16,7 @@ const USAGE: &str = help_usage!("lscpu.md");
|
|||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let _matches: clap::ArgMatches = uu_app().try_get_matches_from(args)?;
|
let _matches: clap::ArgMatches = uu_app().try_get_matches_from(args)?;
|
||||||
let system = System::new_all();
|
let system = System::new_all();
|
||||||
let hex= _matches.get_flag(options::HEX);
|
let hex = _matches.get_flag(options::HEX);
|
||||||
|
|
||||||
println!("Architecture: {}", get_architecture());
|
println!("Architecture: {}", get_architecture());
|
||||||
if hex {
|
if hex {
|
||||||
|
@ -9,3 +9,8 @@ use crate::common::util::TestScenario;
|
|||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_lscpt_with_arg() {
|
||||||
|
new_ucmd!().arg("--hex").succeeds().stdout_contains("0x");
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user