aboutsummaryrefslogtreecommitdiff
path: root/testsuite/tr
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-19 22:22:06 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-19 22:22:06 +0000
commit6ecb8284b5d304b2018119d38fdd57a4b571b252 (patch)
tree3c5c6d2e1cfe06cb2fbd7bc41d5076b75976b595 /testsuite/tr
parente0841316a45656eedefbb639c7b1f2912ec57d68 (diff)
downloadbusybox-w32-6ecb8284b5d304b2018119d38fdd57a4b571b252.tar.gz
busybox-w32-6ecb8284b5d304b2018119d38fdd57a4b571b252.tar.bz2
busybox-w32-6ecb8284b5d304b2018119d38fdd57a4b571b252.zip
Patch from Jean Wolter:
it looks like the introduced support for character classes and equivalence classes is not correct. The attached patch tries to fix some symptoms and tries to make tr behave like gnu tr for the added test cases. The patch  - removes if clauses with side effects  - fixes handling of buffer pointer (strcat added characters to the    buffer without increasing the buffer pointer)  - re-arranges character classes to match ASCII order regards, Jean git-svn-id: svn://busybox.net/trunk/busybox@14926 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'testsuite/tr')
-rw-r--r--testsuite/tr/tr-works29
1 files changed, 22 insertions, 7 deletions
diff --git a/testsuite/tr/tr-works b/testsuite/tr/tr-works
index 8753a3f28..b7a6e8df7 100644
--- a/testsuite/tr/tr-works
+++ b/testsuite/tr/tr-works
@@ -1,9 +1,24 @@
1echo "cbaab" | tr abc zyx > logfile.gnu 1run_tr ()
2echo "TESTING A B C" | tr [A-Z] [a-z] >> logfile.gnu 2{
3echo abc[] | tr a[b AXB >> logfile.gnu 3 echo -n "echo '$1' | tr '$2' '$3': "
4 4 echo "$1" | $bb tr "$2" "$3"
5echo "cbaab" | busybox tr abc zyx > logfile.bb 5 echo
6echo "TESTING A B C" | busybox tr [A-Z] [a-z] >> logfile.bb 6}
7echo abc[] | busybox tr a[b AXB >> logfile.bb 7tr_test ()
8{
9 run_tr "cbaab" abc zyx
10 run_tr "TESTING A B C" '[A-Z]' '[a-z]'
11 run_tr "abc[]" "a[b" AXB
12 run_tr abc '[:alpha:]' A-ZA-Z
13 run_tr abc56 '[:alnum:]' A-ZA-Zxxxxxxxxxx
14 run_tr 012 '[:digit:]' abcdefghi
15 run_tr abc56 '[:lower:]' '[:upper:]'
16 run_tr " " '[:space:]' 12345
17 run_tr " " '[:blank:]' 12
18 run_tr 'a b' '[= =]' X
19 run_tr "[:" '[:' ab
20}
8 21
22bb= tr_test > logfile.gnu
23bb=busybox tr_test > logfile.bb
9cmp logfile.gnu logfile.bb 24cmp logfile.gnu logfile.bb