mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
test_sort: Preserve the environment variable when executing tests (#3031)
* test_sort: Output sorted files to a file with different name Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.43262@gmail.com> * Fix the test by saving the environment variable Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.43262@gmail.com> Co-authored-by: Hanif Bin Ariffin <hanif.ariffin.43262@gmail.com>
This commit is contained in:
parent
2d3b8db9ed
commit
e60b581c38
1 changed files with 5 additions and 2 deletions
|
@ -1066,10 +1066,13 @@ fn test_separator_null() {
|
|||
#[test]
|
||||
fn test_output_is_input() {
|
||||
let input = "a\nb\nc\n";
|
||||
let (at, mut cmd) = at_and_ucmd!();
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
at.touch("file");
|
||||
at.append("file", input);
|
||||
cmd.args(&["-m", "-u", "-o", "file", "file", "file", "file"])
|
||||
scene
|
||||
.ucmd_keepenv()
|
||||
.args(&["-m", "-u", "-o", "file", "file", "file", "file"])
|
||||
.succeeds();
|
||||
assert_eq!(at.read("file"), input);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue