1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00
This commit is contained in:
electricboogie 2021-04-18 13:43:41 -05:00
parent da94e35044
commit dad7761be9
3 changed files with 83 additions and 20 deletions

View file

@ -8,6 +8,16 @@ fn test_helper(file_name: &str, args: &str) {
.stdout_is_fixture(format!("{}.expected", file_name));
}
#[test]
fn test_larger_than_specified_segment() {
new_ucmd!()
.arg("-n")
.arg("-S 100")
.arg("numeric_unsorted_ints.txt")
.succeeds()
.stdout_is_fixture(format!("{}", "numeric_unsorted_ints.expected"));
}
#[test]
fn test_months_whitespace() {
test_helper("months-whitespace", "-M");
@ -100,21 +110,6 @@ fn test_random_shuffle_two_runs_not_the_same() {
assert_ne!(result, unexpected);
}
#[test]
fn test_random_shuffle_contains_two_runs_not_the_same() {
// check to verify that two random shuffles are not equal; this has the
// potential to fail in the unlikely event that random order is the same
// as the starting order, or if both random sorts end up having the same order.
const FILE: &'static str = "default_unsorted_ints.expected";
let (at, _ucmd) = at_and_ucmd!();
let result = new_ucmd!().arg("-R").arg(FILE).run().stdout_move_str();
let expected = at.read(FILE);
let unexpected = new_ucmd!().arg("-R").arg(FILE).run().stdout_move_str();
assert_ne!(result, expected);
assert_ne!(result, unexpected);
}
#[test]
fn test_numeric_floats_and_ints() {
test_helper("numeric_floats_and_ints", "-n");