summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-02-02 23:08:42 +0000
committerPádraig Brady <P@draigBrady.com>2011-02-03 10:19:34 +0000
commitd846bc8babb0764c895fc94f91b97e33851094fb (patch)
treed9bb7206cb9f74d5cd21f570e9d99d63cf2d8e19 /tests
parent4e9ab7d3d87c24ff0671fc7c3be8c0a0873009ab (diff)
downloadcoreutils-d846bc8babb0764c895fc94f91b97e33851094fb.tar.xz
sort: fix --debug key highlighting when key start after key end
This case was overlooked in commit bdde34f9, 2010-08-05, "sort: tune and refactor --debug code, and fix minor underlining bug" * src/sort.c (debug_key): Don't adjust the key end when it's before the key start. * tests/misc/sort-debug-keys: Add a test case.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/sort-debug-keys7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/misc/sort-debug-keys b/tests/misc/sort-debug-keys
index daa6c18b0..238c33e23 100755
--- a/tests/misc/sort-debug-keys
+++ b/tests/misc/sort-debug-keys
@@ -234,6 +234,10 @@ _
_
>a
_
+A>chr10
+ ^ no match for key
+B>chr1
+ ^ no match for key
EOF
(
@@ -275,6 +279,9 @@ env printf '1a\x002b\x00' | sort -s -n -z --debug
# Check that \0 and \t intermix.
printf '\0\ta\n' | sort -s -k2b,2 --debug | tr -d '\0'
+
+# Check that key end before key start is not underlined
+printf 'A\tchr10\nB\tchr1\n' | sort -s -k2.4b,2.3n --debug
) > out
compare out exp || fail=1