tests/dmesg: create test for --kmsg-file and --json option.
This commit is contained in:
21
tests/by-util/test_dmesg.rs
Normal file
21
tests/by-util/test_dmesg.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
use crate::common::util::TestScenario;
|
||||
|
||||
#[test]
|
||||
fn test_invalid_arg() {
|
||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kmsg_json() {
|
||||
new_ucmd!()
|
||||
.arg("--kmsg-file")
|
||||
.arg("kmsg.input")
|
||||
.arg("--json")
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is_fixture("test_kmsg_json.expected");
|
||||
}
|
Reference in New Issue
Block a user