mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 21:47:46 +00:00
Merge pull request #2462 from miDeb/sort/version
sort/ls: implement version cmp matching GNU spec
This commit is contained in:
commit
6213a2a967
12 changed files with 423 additions and 360 deletions
|
@ -127,11 +127,7 @@ fn test_months_whitespace() {
|
|||
|
||||
#[test]
|
||||
fn test_version_empty_lines() {
|
||||
new_ucmd!()
|
||||
.arg("-V")
|
||||
.arg("version-empty-lines.txt")
|
||||
.succeeds()
|
||||
.stdout_is("\n\n\n\n\n\n\n1.2.3-alpha\n1.2.3-alpha2\n\t\t\t1.12.4\n11.2.3\n");
|
||||
test_helper("version-empty-lines", &["-V", "--version-sort"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -8,4 +8,8 @@
|
|||
1.2.3-alpha
|
||||
1.2.3-alpha2
|
||||
11.2.3
|
||||
bar2
|
||||
bar2.0.0
|
||||
foo0.1
|
||||
foo1.0
|
||||
1.12.4
|
||||
|
|
45
tests/fixtures/sort/version-empty-lines.expected.debug
vendored
Normal file
45
tests/fixtures/sort/version-empty-lines.expected.debug
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
|
||||
^ no match for key
|
||||
^ no match for key
|
||||
1.2.3-alpha
|
||||
___________
|
||||
___________
|
||||
1.2.3-alpha2
|
||||
____________
|
||||
____________
|
||||
11.2.3
|
||||
______
|
||||
______
|
||||
bar2
|
||||
____
|
||||
____
|
||||
bar2.0.0
|
||||
________
|
||||
________
|
||||
foo0.1
|
||||
______
|
||||
______
|
||||
foo1.0
|
||||
______
|
||||
______
|
||||
>>>1.12.4
|
||||
_________
|
||||
_________
|
4
tests/fixtures/sort/version-empty-lines.txt
vendored
4
tests/fixtures/sort/version-empty-lines.txt
vendored
|
@ -9,3 +9,7 @@
|
|||
|
||||
|
||||
1.12.4
|
||||
foo1.0
|
||||
foo0.1
|
||||
bar2.0.0
|
||||
bar2
|
Loading…
Add table
Add a link
Reference in a new issue