Skip to content

Commit ee0b350

Browse files
committed
kargs: Add a few more unit tests
Signed-off-by: Colin Walters <[email protected]>
1 parent 2609db6 commit ee0b350

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/src/kargs.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,13 @@ match-architectures = ["x86_64", "aarch64"]
169169
let parsed_kargs = parse_kargs_toml(&file_content, &sys_arch).unwrap();
170170
assert_eq!(parsed_kargs, ["console=tty0", "nosmt"]);
171171
}
172+
173+
#[test]
174+
/// Verify some error cases
175+
fn test_invalid() {
176+
let test_invalid_extra = r#"kargs = ["console=tty0", "nosmt"]\nfoo=bar"#;
177+
assert!(parse_kargs_toml(test_invalid_extra, "x86_64").is_err());
178+
179+
let test_missing = r#"foo=bar"#;
180+
assert!(parse_kargs_toml(test_missing, "x86_64").is_err());
181+
}

0 commit comments

Comments
 (0)