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/numeric6.txt b/tests/fixtures/sort/numeric_unsorted_ints.txt similarity index 100% rename from tests/fixtures/sort/numeric6.txt rename to tests/fixtures/sort/numeric_unsorted_ints.txt diff --git a/tests/sort.rs b/tests/sort.rs index ef6bdc4b1..9edfa52d3 100644 --- a/tests/sort.rs +++ b/tests/sort.rs @@ -7,54 +7,45 @@ static UTIL_NAME: &'static str = "sort"; #[test] -fn numeric1() { - numeric_helper(1); +fn test_numeric_floats_and_ints() { + test_helper("numeric_floats_and_ints", &String::from("-n")); } #[test] -fn numeric2() { - numeric_helper(2); +fn test_numeric_floats() { + test_helper("numeric_floats", &String::from("-n")); } #[test] -fn numeric3() { - numeric_helper(3); +fn test_numeric_unfixed_floats() { + test_helper("numeric_unfixed_floats", &String::from("-n")); } #[test] -fn numeric4() { - numeric_helper(4); +fn test_numeric_fixed_floats() { + test_helper("numeric_fixed_floats", &String::from("-n")); } #[test] -fn numeric5() { - numeric_helper(5); +fn test_numeric_unsorted_ints() { + test_helper("numeric_unsorted_ints", &String::from("-n")); } #[test] -fn numeric6() { - numeric_helper(6); +fn test_human_block_sizes() { + test_helper("human_block_sizes", &String::from("-h")); } #[test] -fn human1() { - test_helper(&String::from("human1"), &String::from("-h")); +fn test_month_default() { + test_helper("month_default", &String::from("-M")); } -#[test] -fn month1() { - test_helper(&String::from("month1"), &String::from("-M")); -} - -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: &String) { 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)); }