1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 20:47:46 +00:00

relpath(test) - fix: 'value assigned to 'result_stdout' is never read'

This commit is contained in:
Sylvestre Ledru 2021-05-02 09:42:30 +02:00
parent c03a7d8856
commit a34b49ad60

View file

@ -103,7 +103,7 @@ fn test_relpath_with_from_with_d() {
at.mkdir_all(from);
// d is part of subpath -> expect relative path
let mut result_stdout = scene
let mut _result_stdout = scene
.ucmd()
.arg(to)
.arg(from)
@ -112,17 +112,17 @@ fn test_relpath_with_from_with_d() {
.stdout_move_str();
// relax rules for windows test environment
#[cfg(not(windows))]
assert!(Path::new(&result_stdout).is_relative());
assert!(Path::new(&_result_stdout).is_relative());
// d is not part of subpath -> expect absolut path
result_stdout = scene
_result_stdout = scene
.ucmd()
.arg(to)
.arg(from)
.arg("-dnon_existing")
.succeeds()
.stdout_move_str();
assert!(Path::new(&result_stdout).is_absolute());
assert!(Path::new(&_result_stdout).is_absolute());
}
}
@ -135,12 +135,12 @@ fn test_relpath_no_from_no_d() {
let to: &str = &convert_path(test.to);
at.mkdir_all(to);
let result_stdout = scene.ucmd().arg(to).succeeds().stdout_move_str();
let _result_stdout = scene.ucmd().arg(to).succeeds().stdout_move_str();
#[cfg(not(windows))]
assert_eq!(result_stdout, format!("{}\n", to));
assert_eq!(_result_stdout, format!("{}\n", to));
// relax rules for windows test environment
#[cfg(windows)]
assert!(result_stdout.ends_with(&format!("{}\n", to)));
assert!(_result_stdout.ends_with(&format!("{}\n", to)));
}
}