Skip to content

Commit 4db5a60

Browse files
committed
ls: add back version cmp test
1 parent e5331e3 commit 4db5a60

1 file changed

Lines changed: 45 additions & 4 deletions

File tree

tests/by-util/test_ls.rs

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,15 +2311,56 @@ fn test_ls_version_sort() {
23112311
let scene = TestScenario::new(util_name!());
23122312
let at = &scene.fixtures;
23132313
for filename in [
2314-
"a2", "b1", "b20", "a1.4", "b3", "b11", "b20b", "b20a", "a100", "a1.13", "aa", "a1", "aaa",
2315-
"abab", "ab", "a01.40", "a001.001",
2314+
"a2",
2315+
"b1",
2316+
"b20",
2317+
"a1.4",
2318+
"a1.40",
2319+
"b3",
2320+
"b11",
2321+
"b20b",
2322+
"b20a",
2323+
"a100",
2324+
"a1.13",
2325+
"aa",
2326+
"a1",
2327+
"aaa",
2328+
"a1.00000040",
2329+
"abab",
2330+
"ab",
2331+
"a01.40",
2332+
"a001.001",
2333+
"a01.0000001",
2334+
"a01.001",
2335+
"a001.01",
23162336
] {
23172337
at.touch(filename);
23182338
}
23192339

23202340
let mut expected = vec![
2321-
"a1", "a001.001", "a1.4", "a1.13", "a01.40", "a2", "a100", "aa", "aaa", "ab", "abab", "b1",
2322-
"b3", "b11", "b20", "b20a", "b20b", "", // because of '\n' at the end of the output
2341+
"a1",
2342+
"a001.001",
2343+
"a001.01",
2344+
"a01.0000001",
2345+
"a01.001",
2346+
"a1.4",
2347+
"a1.13",
2348+
"a01.40",
2349+
"a1.00000040",
2350+
"a1.40",
2351+
"a2",
2352+
"a100",
2353+
"aa",
2354+
"aaa",
2355+
"ab",
2356+
"abab",
2357+
"b1",
2358+
"b3",
2359+
"b11",
2360+
"b20",
2361+
"b20a",
2362+
"b20b",
2363+
"", // because of '\n' at the end of the output
23232364
];
23242365

23252366
let result = scene.ucmd().arg("-1v").succeeds();

0 commit comments

Comments
 (0)