1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

Merge pull request #4279 from rivy/up.uname

change/uname ~ update and revise
This commit is contained in:
Sylvestre Ledru 2023-01-18 11:33:29 +01:00 committed by GitHub
commit afbe850115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 56 deletions

View file

@ -104,10 +104,11 @@ fn test_uname_operating_system() {
.succeeds()
.stdout_is("Redox\n");
#[cfg(target_os = "windows")]
new_ucmd!()
.arg("--operating-system")
.succeeds()
.stdout_is("Windows NT\n");
{
let result = new_ucmd!().arg("--operating-system").succeeds();
println!("{:?}", result.stdout_str());
assert!(result.stdout_str().starts_with("MS/Windows"));
}
}
#[test]
@ -117,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);
}