forked from extern/nushell
Make comparisons/sort-by more 'global' (#4500)
* Make comparisons/sort-by more 'global' * Let custom values do their own comparisons
This commit is contained in:
@ -146,3 +146,16 @@ fn ls_sort_by_type_name_insensitive() {
|
||||
let json_output = r#"[{"name": "C","type": "Dir"},{"name": "a.txt","type": "File"},{"name": "B.txt","type": "File"}]"#;
|
||||
assert_eq!(actual.out, json_output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sort_different_types() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
[a, 1, b, 2, c, 3, [4, 5, 6], d, 4, [1, 2, 3]] | sort-by | to json --raw
|
||||
"#
|
||||
));
|
||||
|
||||
let json_output = r#"[1,2,3,4,"a","b","c","d",[1,2,3],[4,5,6]]"#;
|
||||
assert_eq!(actual.out, json_output);
|
||||
}
|
||||
|
Reference in New Issue
Block a user