1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

Sort: More small fixes (#2065)

* Various fixes and performance improvements

* fix a typo

Co-authored-by: Michael Debertol <michael.debertol@gmail.com>

* Fix month parse for months with leading whitespace

* Implement test for months whitespace fix

* Confirm human numeric works as expected with whitespace with a test

* Correct arg help value name for --parallel

* Fix SemVer non version lines/empty line sorting with a test

Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
Co-authored-by: Michael Debertol <michael.debertol@gmail.com>
This commit is contained in:
electricboogie 2021-04-17 03:06:19 -05:00 committed by GitHub
parent 279656426b
commit a76d452f75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 94 additions and 6 deletions

View file

@ -8,6 +8,25 @@ fn test_helper(file_name: &str, args: &str) {
.stdout_is_fixture(format!("{}.expected", file_name));
}
#[test]
fn test_months_whitespace() {
test_helper("months-whitespace", "-M");
}
#[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]
fn test_human_numeric_whitespace() {
test_helper("human-numeric-whitespace", "-h");
}
#[test]
fn test_multiple_decimals_general() {
new_ucmd!()

View file

@ -0,0 +1,11 @@
456K
4568K
456M
6.2G

View file

@ -0,0 +1,11 @@
456K
456M
4568K
6.2G

View file

@ -0,0 +1,8 @@
JAN
FEb
apr
apr
JUNNNN
AUG

View file

@ -0,0 +1,8 @@
JAN
JUNNNN
AUG
apr
apr
FEb

View file

@ -0,0 +1,11 @@
1.2.3-alpha
1.2.3-alpha2
11.2.3
1.12.4

View file

@ -0,0 +1,11 @@
11.2.3
1.2.3-alpha2
1.2.3-alpha
1.12.4