1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

tests/util: Don't trim output in CmdResult::stdout_matches and stdout_does_not_match (#4304)

* tests/util: Fix documentation of UCommand::stderr_only and usage_error

* tests/util: Remove trimming from CmdResult::stdout_matches and stdout_does_not_match. Fix tests.

The tests are fixed to match the trailing newline instead of ignoring it.
This commit is contained in:
Joining7943 2023-02-16 15:33:33 +01:00 committed by GitHub
parent ff5000d4d0
commit f610f33aa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

View file

@ -300,7 +300,7 @@ fn test_relative_base_not_prefix_of_relative_to() {
.succeeds();
#[cfg(windows)]
result.stdout_matches(&Regex::new(r"^.*:\\usr\n.*:\\usr\\local$").unwrap());
result.stdout_matches(&Regex::new(r"^.*:\\usr\n.*:\\usr\\local\n$").unwrap());
#[cfg(not(windows))]
result.stdout_is("/usr\n/usr/local\n");
@ -344,7 +344,7 @@ fn test_relative() {
#[cfg(not(windows))]
result.stdout_is("/tmp\n.\n");
#[cfg(windows)]
result.stdout_matches(&Regex::new(r"^.*:\\tmp\n\.$").unwrap());
result.stdout_matches(&Regex::new(r"^.*:\\tmp\n\.\n$").unwrap());
new_ucmd!()
.args(&["-sm", "--relative-base=/", "--relative-to=/", "/", "/usr"])
@ -357,7 +357,7 @@ fn test_relative() {
#[cfg(not(windows))]
result.stdout_is("/tmp\n.\n");
#[cfg(windows)]
result.stdout_matches(&Regex::new(r"^.*:\\tmp\n\.$").unwrap());
result.stdout_matches(&Regex::new(r"^.*:\\tmp\n\.\n$").unwrap());
new_ucmd!()
.args(&["-sm", "--relative-base=/", "/", "/usr"])