From 336c44adca1768ada1e1e2f4d7dbbc33e994e582 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 2 Mar 2016 15:20:04 -0600 Subject: Factor out command name at the start of test name, have runtest.sh print it. --- tests/sort.test | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/sort.test') diff --git a/tests/sort.test b/tests/sort.test index 2845e79c..cda3db51 100755 --- a/tests/sort.test +++ b/tests/sort.test @@ -8,10 +8,10 @@ # The basic tests. These should work even with the small config. testing "sort" "sort input" "a\nb\nc\n" "c\na\nb\n" "" -testing "sort #2" "sort input" "010\n1\n3\n" "3\n1\n010\n" "" -testing "sort stdin" "sort" "a\nb\nc\n" "" "b\na\nc\n" -testing "sort numeric" "sort -n input" "1\n3\n010\n" "3\n1\n010\n" "" -testing "sort reverse" "sort -r input" "wook\nwalrus\npoint\npabst\naargh\n" \ +testing "#2" "sort input" "010\n1\n3\n" "3\n1\n010\n" "" +testing "stdin" "sort" "a\nb\nc\n" "" "b\na\nc\n" +testing "numeric" "sort -n input" "1\n3\n010\n" "3\n1\n010\n" "" +testing "reverse" "sort -r input" "wook\nwalrus\npoint\npabst\naargh\n" \ "point\nwook\npabst\naargh\nwalrus\n" "" # These tests require the full option set. @@ -29,7 +29,7 @@ egg 1 2 papyrus # Sorting with keys -testing "sort one key" "sort -k4,4 input" \ +testing "one key" "sort -k4,4 input" \ "999 3 0 algebra egg 1 2 papyrus 7 3 42 soup @@ -41,7 +41,7 @@ egg 1 2 papyrus # at the whitespace), then the global fallback sort does an alpha sort on # the whole string (starting at the beginning of the line). -testing "sort key range with numeric option" "sort -k2,3n input" \ +testing "key range with numeric option" "sort -k2,3n input" \ "42 1 010 zoology 42 1 3 woot egg 1 2 papyrus @@ -52,7 +52,7 @@ egg 1 2 papyrus # Numeric sort on field 2 (again, ignore field 3 because it's numeric), # then do a _reversed_ alpha sort on the whole line as a tiebreaker. -testing "sort key range with numeric option and global reverse" \ +testing "key range with numeric option and global reverse" \ "sort -k2,3n -r input" \ "egg 1 2 papyrus 42 1 3 woot @@ -64,7 +64,7 @@ testing "sort key range with numeric option and global reverse" \ # Reversed numeric sort on field 2 (numeric ignores field 3), then # break ties with alpha sort on whole line. -testing "sort key range with multiple options" "sort -k2,3rn input" \ +testing "key range with multiple options" "sort -k2,3rn input" \ "7 3 42 soup 999 3 0 algebra 42 1 010 zoology @@ -72,12 +72,12 @@ testing "sort key range with multiple options" "sort -k2,3rn input" \ egg 1 2 papyrus " "$data" "" -testing "sort key doesn't strip leading blanks, disables fallback global sort" \ +testing "key doesn't strip leading blanks, disables fallback global sort" \ "sort -n -k2 -t ' '" " a \n 1 \n 2 \n" "" " 2 \n 1 \n a \n" # Test case contributed by Joey Hess: -testing "sort key edge case with -t" "sort -n -k4 -t/" \ +testing "key edge case with -t" "sort -n -k4 -t/" \ "/usr/lib/finish-install.d/1 /usr/lib/finish-install.d/4 /usr/lib/prebaseconfig.d/2 @@ -88,7 +88,7 @@ testing "sort key edge case with -t" "sort -n -k4 -t/" \ /usr/lib/prebaseconfig.d/6 " -testing "sort -x" "sort -x" "010\na0\n 0c0\n" "" "a0\n010\n 0c0\n" +testing "-x" "sort -x" "010\na0\n 0c0\n" "" "a0\n010\n 0c0\n" # Test that -f applies to key or fallback independently @@ -99,7 +99,7 @@ testing "" "sort -f -k2,2" "A b b\na B C\na B a\n" "" "a B a\nA b b\na B C\n" optional SORT_FLOAT # not numbers < NaN < -infinity < numbers < +infinity -testing "sort -g" "sort -g" \ +testing "-g" "sort -g" \ "bork\nNaN\n-inf\n0.4\n1.222\n01.37\n2.1\n+infinity\n" "" \ "01.37\n1.222\n2.1\n0.4\nNaN\nbork\n-inf\n+infinity\n" -- cgit v1.2.3