summaryrefslogtreecommitdiffstats
path: root/tests/by-util/test_ls.rs
diff options
context:
space:
mode:
authorJohn Shin <shinhs0506@gmail.com>2023-07-09 15:29:42 -0700
committerJohn Shin <shinhs0506@gmail.com>2023-07-09 15:30:56 -0700
commit4db5a60667005ddc48235463f84ef342776a6014 (patch)
tree1f6dab964c36853bf85b89f15e235ac0665e63fb /tests/by-util/test_ls.rs
parente5331e3abbb52825db4216842f0944e0b8d8ece3 (diff)
ls: add back version cmp test
Diffstat (limited to 'tests/by-util/test_ls.rs')
-rw-r--r--tests/by-util/test_ls.rs49
1 files changed, 45 insertions, 4 deletions
diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs
index a6835f279..2eef69121 100644
--- a/tests/by-util/test_ls.rs
+++ b/tests/by-util/test_ls.rs
@@ -2311,15 +2311,56 @@ fn test_ls_version_sort() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
for filename in [
- "a2", "b1", "b20", "a1.4", "b3", "b11", "b20b", "b20a", "a100", "a1.13", "aa", "a1", "aaa",
- "abab", "ab", "a01.40", "a001.001",
+ "a2",
+ "b1",
+ "b20",
+ "a1.4",
+ "a1.40",
+ "b3",
+ "b11",
+ "b20b",
+ "b20a",
+ "a100",
+ "a1.13",
+ "aa",
+ "a1",
+ "aaa",
+ "a1.00000040",
+ "abab",
+ "ab",
+ "a01.40",
+ "a001.001",
+ "a01.0000001",
+ "a01.001",
+ "a001.01",
] {
at.touch(filename);
}
let mut expected = vec![
- "a1", "a001.001", "a1.4", "a1.13", "a01.40", "a2", "a100", "aa", "aaa", "ab", "abab", "b1",
- "b3", "b11", "b20", "b20a", "b20b", "", // because of '\n' at the end of the output
+ "a1",
+ "a001.001",
+ "a001.01",
+ "a01.0000001",
+ "a01.001",
+ "a1.4",
+ "a1.13",
+ "a01.40",
+ "a1.00000040",
+ "a1.40",
+ "a2",
+ "a100",
+ "aa",
+ "aaa",
+ "ab",
+ "abab",
+ "b1",
+ "b3",
+ "b11",
+ "b20",
+ "b20a",
+ "b20b",
+ "", // because of '\n' at the end of the output
];
let result = scene.ucmd().arg("-1v").succeeds();