summaryrefslogtreecommitdiff
path: root/tests/sort
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-11-30 20:06:06 +0000
committerJim Meyering <jim@meyering.net>1995-11-30 20:06:06 +0000
commit155639bf0f92431eb282b05b44634bd2fa4151de (patch)
treec6ea3d8da8bc1d9b8a1b1d8d663f5475c0a3eedf /tests/sort
parentc0f51577fde0332233fa3a212afee2378af2cc41 (diff)
downloadcoreutils-155639bf0f92431eb282b05b44634bd2fa4151de.tar.xz
Lots of new tests -- related to -k2,2 bug and non-functional -b and `b'.
Diffstat (limited to 'tests/sort')
-rwxr-xr-xtests/sort/test.data.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/sort/test.data.pl b/tests/sort/test.data.pl
index 1d19b5a35..92ea8b188 100755
--- a/tests/sort/test.data.pl
+++ b/tests/sort/test.data.pl
@@ -65,3 +65,21 @@
("10c", '-t : -k 2.2,2.2', ":ab\n:ba\n", ":ba\n:ab\n", 0);
# Equivalent to above, but using obsolescent `+pos -pos' option syntax.
("10d", '-t : +1.1 -1.2', ":ab\n:ba\n", ":ba\n:ab\n", 0);
+# Try without -t...
+# But note that we have to count the delimiting space at the beginning
+# of each field that has it.
+("10a0", '-k 2.3,2.3', "z ba\nz ab\n", "z ba\nz ab\n", 0);
+("10a1", '-k 1.2,1.2', "ba\nab\n", "ba\nab\n", 0);
+("10a2", '-b -k 2.2,2.2', "z ba\nz ab\n", "z ba\nz ab\n", 0);
+#
+# An even simpler example demonstrating the bug.
+("10e", '-k 1.2,1.2', "ab\nba\n", "ba\nab\n", 0);
+#
+("10f", '-t : -k 1.3,1.3', ":ab\n:ba\n", ":ab\n:ba\n", 0);
+("10g", '-k 1.4,1.4', "a ab\nb ba\n", "a ab\nb ba\n", 0);
+#
+# Exercise bug re using -b to skip trailing blanks.
+("11a", '-t: -k1,1b -k2,2', "a\t:a\na :b\n", "a\t:a\na :b\n", 0);
+("11b", '-t: -k1,1b -k2,2', "a :b\na\t:a\n", "a\t:a\na :b\n", 0);
+("11c", '-t: -k2,2b -k3,3', "z:a\t:a\na :b\n", "z:a\t:a\na :b\n", 0);
+("11d", '-t: -k2,2b -k3,3', "z:a :b\na\t:a\n", "a\t:a\nz:a :b\n", 0);