Skip to content

Commit 86506ce

Browse files
committed
test: Add test_sort_by_size_with_exec_batch
1 parent 90e6539 commit 86506ce

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/tests.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,21 @@ fn test_sort_by_size_with_exec() {
21162116
);
21172117
}
21182118

2119+
/// Shell script execution with --sort (--exec-batch)
2120+
#[cfg(not(windows))]
2121+
#[test]
2122+
fn test_sort_by_size_with_exec_batch() {
2123+
let te = TestEnv::new_with_sized_files(DEFAULT_DIRS, DEFAULT_FILES_WITH_SIZES)
2124+
.normalize_line(false) // Assert order exactly as input.
2125+
.allow_random_result_order(false);
2126+
2127+
// --exec-batch with --sort should maintain the sorted order in its arguments.
2128+
te.assert_output(
2129+
&["foo", "--sort=size", "--exec-batch", "echo"],
2130+
"./one/two/three/directory_foo ./one/two/c.foo ./one/two/three/d.foo ./a.foo ./one/two/C.Foo2 ./one/b.foo",
2131+
);
2132+
}
2133+
21192134
/// Shell script execution (--exec) with a custom --path-separator
21202135
#[test]
21212136
fn test_exec_with_separator() {

0 commit comments

Comments
 (0)