summaryrefslogtreecommitdiff
path: root/tests/tr
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2007-10-21 12:38:33 +0200
committerJim Meyering <meyering@redhat.com>2007-10-21 14:01:28 +0200
commitaf5d0c363a52e787a4311a11f035209eecdc4115 (patch)
tree30ee17355928ee3ba04a78d66b2f290d8a47e159 /tests/tr
parentc365bafa815695e187089ab711eca4ca55282b0d (diff)
downloadcoreutils-af5d0c363a52e787a4311a11f035209eecdc4115.tar.xz
tr: do not reject an unmatched [:lower:] or [:upper:] in SET1.
* NEWS: Mention this. * src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when processing [:lower:] and [:upper:]. (main): Require [:lower:] or [:upper:] in SET1 only when when one of those is specified in SET2. * tests/tr/Test.pm: Add tests for this fix. Reported by Per Starbäck. Signed-off-by: Jim Meyering <meyering@redhat.com>
Diffstat (limited to 'tests/tr')
-rw-r--r--tests/tr/Test.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/tr/Test.pm b/tests/tr/Test.pm
index 1bb9aca44..804c5cb38 100644
--- a/tests/tr/Test.pm
+++ b/tests/tr/Test.pm
@@ -135,6 +135,10 @@ my @tv = (
# Prior to coreutils-6.10, this would provoke a failed assertion.
['no-abort-1', '-c ' . q|a '[b*256]'|, 'abc', 'abb', 0],
+
+# Up to coreutils-6.9, tr rejected an unmatched [:lower:] or [:upper:] in SET1.
+['s1-lower', q|'[:lower:]' '[.*]'|, '#$%123abcABC', '#$%123...ABC', 0],
+['s1-upper', q|'[:upper:]' '[.*]'|, '#$%123abcABC', '#$%123abc...', 0],
);
sub test_vector