mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
test/uname ~ test for invisible characters in output (ie, NULs)
This commit is contained in:
parent
cfdbaca6c1
commit
b4e3e66236
1 changed files with 8 additions and 0 deletions
|
@ -118,3 +118,11 @@ fn test_uname_help() {
|
|||
.succeeds()
|
||||
.stdout_contains("system information");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_uname_output_for_invisible_chars() {
|
||||
// let re = regex::Regex::new("[^[[:print:]]]").unwrap(); // matches invisible (and emojis)
|
||||
let re = regex::Regex::new("[^[[:print:]]\\p{Other_Symbol}]").unwrap(); // matches invisible (not emojis)
|
||||
let result = new_ucmd!().arg("--all").succeeds();
|
||||
assert_eq!(re.find(result.stdout_str().trim_end()), None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue