diff --git a/tests/fixtures/sort/default_unsorted_ints.expected b/tests/fixtures/sort/default_unsorted_ints.expected new file mode 100644 index 000000000..5c8fcffdf --- /dev/null +++ b/tests/fixtures/sort/default_unsorted_ints.expected @@ -0,0 +1,100 @@ +1 +10 +100 +11 +12 +13 +14 +15 +16 +17 +18 +19 +2 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +3 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +4 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +5 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +6 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +7 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +8 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +9 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 diff --git a/tests/fixtures/sort/numeric6.txt b/tests/fixtures/sort/default_unsorted_ints.txt similarity index 100% rename from tests/fixtures/sort/numeric6.txt rename to tests/fixtures/sort/default_unsorted_ints.txt diff --git a/tests/fixtures/sort/human1.ans b/tests/fixtures/sort/human_block_sizes.expected similarity index 100% rename from tests/fixtures/sort/human1.ans rename to tests/fixtures/sort/human_block_sizes.expected diff --git a/tests/fixtures/sort/human1.txt b/tests/fixtures/sort/human_block_sizes.txt similarity index 100% rename from tests/fixtures/sort/human1.txt rename to tests/fixtures/sort/human_block_sizes.txt diff --git a/tests/fixtures/sort/month1.ans b/tests/fixtures/sort/month_default.expected similarity index 100% rename from tests/fixtures/sort/month1.ans rename to tests/fixtures/sort/month_default.expected diff --git a/tests/fixtures/sort/month1.txt b/tests/fixtures/sort/month_default.txt similarity index 100% rename from tests/fixtures/sort/month1.txt rename to tests/fixtures/sort/month_default.txt diff --git a/tests/fixtures/sort/numeric5.ans b/tests/fixtures/sort/numeric5.ans deleted file mode 100644 index 4c59f5cda..000000000 --- a/tests/fixtures/sort/numeric5.ans +++ /dev/null @@ -1,2 +0,0 @@ -.022 -.024 diff --git a/tests/fixtures/sort/numeric5.txt b/tests/fixtures/sort/numeric5.txt deleted file mode 100644 index 4c59f5cda..000000000 --- a/tests/fixtures/sort/numeric5.txt +++ /dev/null @@ -1,2 +0,0 @@ -.022 -.024 diff --git a/tests/fixtures/sort/numeric4.ans b/tests/fixtures/sort/numeric_fixed_floats.expected similarity index 100% rename from tests/fixtures/sort/numeric4.ans rename to tests/fixtures/sort/numeric_fixed_floats.expected diff --git a/tests/fixtures/sort/numeric4.txt b/tests/fixtures/sort/numeric_fixed_floats.txt similarity index 100% rename from tests/fixtures/sort/numeric4.txt rename to tests/fixtures/sort/numeric_fixed_floats.txt diff --git a/tests/fixtures/sort/numeric2.ans b/tests/fixtures/sort/numeric_floats.expected similarity index 100% rename from tests/fixtures/sort/numeric2.ans rename to tests/fixtures/sort/numeric_floats.expected diff --git a/tests/fixtures/sort/numeric2.txt b/tests/fixtures/sort/numeric_floats.txt similarity index 100% rename from tests/fixtures/sort/numeric2.txt rename to tests/fixtures/sort/numeric_floats.txt diff --git a/tests/fixtures/sort/numeric1.ans b/tests/fixtures/sort/numeric_floats_and_ints.expected similarity index 100% rename from tests/fixtures/sort/numeric1.ans rename to tests/fixtures/sort/numeric_floats_and_ints.expected diff --git a/tests/fixtures/sort/numeric1.txt b/tests/fixtures/sort/numeric_floats_and_ints.txt similarity index 100% rename from tests/fixtures/sort/numeric1.txt rename to tests/fixtures/sort/numeric_floats_and_ints.txt diff --git a/tests/fixtures/sort/numeric3.ans b/tests/fixtures/sort/numeric_unfixed_floats.expected similarity index 100% rename from tests/fixtures/sort/numeric3.ans rename to tests/fixtures/sort/numeric_unfixed_floats.expected diff --git a/tests/fixtures/sort/numeric3.txt b/tests/fixtures/sort/numeric_unfixed_floats.txt similarity index 100% rename from tests/fixtures/sort/numeric3.txt rename to tests/fixtures/sort/numeric_unfixed_floats.txt diff --git a/tests/fixtures/sort/numeric6.ans b/tests/fixtures/sort/numeric_unsorted_ints.expected similarity index 100% rename from tests/fixtures/sort/numeric6.ans rename to tests/fixtures/sort/numeric_unsorted_ints.expected diff --git a/tests/fixtures/sort/numeric_unsorted_ints.txt b/tests/fixtures/sort/numeric_unsorted_ints.txt new file mode 100644 index 000000000..d3c2bb861 --- /dev/null +++ b/tests/fixtures/sort/numeric_unsorted_ints.txt @@ -0,0 +1,100 @@ +33 +16 +35 +56 +72 +37 +21 +49 +70 +48 +90 +83 +44 +79 +10 +20 +4 +26 +27 +63 +29 +47 +51 +85 +88 +46 +30 +61 +93 +81 +78 +53 +87 +18 +98 +38 +13 +39 +23 +71 +5 +100 +96 +8 +24 +14 +28 +15 +25 +43 +36 +67 +75 +66 +31 +57 +34 +80 +40 +86 +17 +55 +9 +1 +62 +12 +74 +58 +69 +76 +11 +73 +68 +59 +41 +45 +52 +97 +82 +6 +7 +77 +42 +84 +95 +94 +89 +19 +64 +2 +22 +50 +60 +32 +92 +3 +99 +65 +54 +91 diff --git a/tests/sort.rs b/tests/sort.rs index ef6bdc4b1..5544290c8 100644 --- a/tests/sort.rs +++ b/tests/sort.rs @@ -7,54 +7,50 @@ static UTIL_NAME: &'static str = "sort"; #[test] -fn numeric1() { - numeric_helper(1); +fn test_numeric_floats_and_ints() { + test_helper("numeric_floats_and_ints", "-n"); } #[test] -fn numeric2() { - numeric_helper(2); +fn test_numeric_floats() { + test_helper("numeric_floats", "-n"); } #[test] -fn numeric3() { - numeric_helper(3); +fn test_numeric_unfixed_floats() { + test_helper("numeric_unfixed_floats", "-n"); } #[test] -fn numeric4() { - numeric_helper(4); +fn test_numeric_fixed_floats() { + test_helper("numeric_fixed_floats", "-n"); } #[test] -fn numeric5() { - numeric_helper(5); +fn test_numeric_unsorted_ints() { + test_helper("numeric_unsorted_ints", "-n"); } #[test] -fn numeric6() { - numeric_helper(6); +fn test_human_block_sizes() { + test_helper("human_block_sizes", "-h"); } #[test] -fn human1() { - test_helper(&String::from("human1"), &String::from("-h")); +fn test_month_default() { + test_helper("month_default", "-M"); } #[test] -fn month1() { - test_helper(&String::from("month1"), &String::from("-M")); +fn test_default_unsorted_ints() { + test_helper("default_unsorted_ints", ""); } -fn numeric_helper(test_num: isize) { - test_helper(&format!("numeric{}", test_num), &String::from("-n")) -} - -fn test_helper(file_name: &String, args: &String) { +fn test_helper(file_name: &str, args: &str) { let (at, mut ucmd) = testing(UTIL_NAME); ucmd.arg(args); let out = ucmd.arg(format!("{}{}", file_name, ".txt")).run().stdout; - let filename = format!("{}{}", file_name, ".ans"); + let filename = format!("{}{}", file_name, ".expected"); assert_eq!(out, at.read(&filename)); }