Add tests
This commit is contained in:
parent
afd27bdcaf
commit
306a366900
@ -10,6 +10,15 @@ 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_basic() {
|
||||||
|
// Verify basic usage with no args prints both table and summary
|
||||||
|
new_ucmd!()
|
||||||
|
.succeeds()
|
||||||
|
.stdout_contains("STATE REMOVABLE")
|
||||||
|
.stdout_contains("Memory block size:");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_table_not_padded() {
|
fn test_table_not_padded() {
|
||||||
let result = new_ucmd!().succeeds();
|
let result = new_ucmd!().succeeds();
|
||||||
@ -19,3 +28,11 @@ fn test_table_not_padded() {
|
|||||||
"Table output should not start with a space"
|
"Table output should not start with a space"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_json_output() {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-J")
|
||||||
|
.succeeds()
|
||||||
|
.stdout_contains(" \"memory\": [\n");
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user