diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-01 04:50:18 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-01 04:50:18 +0000 |
commit | 1bfcc8b08e511be7228f93079f669d95392ef184 (patch) | |
tree | 72a5d206c0c7707927f5f58c118518330dbd3c73 /testsuite | |
parent | 31773b71e89f79cb5afda834ce15538a8818067d (diff) | |
download | busybox-w32-1bfcc8b08e511be7228f93079f669d95392ef184.tar.gz busybox-w32-1bfcc8b08e511be7228f93079f669d95392ef184.tar.bz2 busybox-w32-1bfcc8b08e511be7228f93079f669d95392ef184.zip |
tr: support [:xdigit:], fix handling of ranges and [x]'s.
add testsuite entry for each of 3 bugs fixed.
function old new delta
static.classes 73 82 +9
expand 1738 1743 +5
complement 74 72 -2
tr_main 472 463 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 14/-11) Total: 3 bytes
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tr.tests | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tr.tests b/testsuite/tr.tests new file mode 100644 index 000000000..7339ccff2 --- /dev/null +++ b/testsuite/tr.tests | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com> | ||
4 | # Licensed under GPL v2, see file LICENSE for details. | ||
5 | |||
6 | . testing.sh | ||
7 | |||
8 | # testing "description" "arguments" "result" "infile" "stdin" | ||
9 | |||
10 | testing "tr does not treat [] in [a-z] as special" \ | ||
11 | "tr '[q-z]' '_Q-Z+'" \ | ||
12 | "_QWe+" "" "[qwe]" | ||
13 | |||
14 | testing "tr understands 0-9A-F" \ | ||
15 | "tr -cd '[0-9A-F]'" \ | ||
16 | "19AF" "" "19AFH\n" | ||
17 | |||
18 | testing "tr understands [:xdigit:]" \ | ||
19 | "tr -cd '[:xdigit:]'" \ | ||
20 | "19AF" "" "19AFH\n" | ||
21 | |||
22 | exit $FAILCOUNT | ||