1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

sort: add tests for stable and unstable sort

This commit is contained in:
John Shin 2023-06-27 12:15:58 -07:00 committed by Sylvestre Ledru
parent b42a5b8741
commit 844cbdc5a4
2 changed files with 22 additions and 5 deletions

View file

@ -134,6 +134,25 @@ fn test_version_empty_lines() {
test_helper("version-empty-lines", &["-V", "--version-sort"]);
}
#[test]
fn test_version_sort_unstable() {
new_ucmd!()
.arg("--sort=version")
.pipe_in("0.1\n0.02\n0.2\n0.002\n0.3\n")
.succeeds()
.stdout_is("0.1\n0.002\n0.02\n0.2\n0.3\n");
}
#[test]
fn test_version_sort_stable() {
new_ucmd!()
.arg("--stable")
.arg("--sort=version")
.pipe_in("0.1\n0.02\n0.2\n0.002\n0.3\n")
.succeeds()
.stdout_is("0.1\n0.02\n0.2\n0.002\n0.3\n");
}
#[test]
fn test_human_numeric_whitespace() {
test_helper(