diff options
Diffstat (limited to 'release/src/router/busybox/testsuite/tr')
5 files changed, 54 insertions, 0 deletions
diff --git a/release/src/router/busybox/testsuite/tr/tr-d-alnum-works b/release/src/router/busybox/testsuite/tr/tr-d-alnum-works new file mode 100644 index 00000000..d440f8f3 --- /dev/null +++ b/release/src/router/busybox/testsuite/tr/tr-d-alnum-works @@ -0,0 +1,4 @@ +echo testing | tr -d '[[:alnum:]]' > logfile.gnu +echo testing | busybox tr -d '[[:alnum:]]' > logfile.bb + +diff -u logfile.gnu logfile.bb diff --git a/release/src/router/busybox/testsuite/tr/tr-d-works b/release/src/router/busybox/testsuite/tr/tr-d-works new file mode 100644 index 00000000..a86bfbdf --- /dev/null +++ b/release/src/router/busybox/testsuite/tr/tr-d-works @@ -0,0 +1,4 @@ +echo testing | tr -d aeiou > logfile.gnu +echo testing | busybox tr -d aeiou > logfile.bb + +diff -u logfile.gnu logfile.bb diff --git a/release/src/router/busybox/testsuite/tr/tr-non-gnu b/release/src/router/busybox/testsuite/tr/tr-non-gnu new file mode 100644 index 00000000..ffa6951a --- /dev/null +++ b/release/src/router/busybox/testsuite/tr/tr-non-gnu @@ -0,0 +1 @@ +echo fdhrnzvfu bffvsentr | busybox tr '[a-z]' '[n-z][a-m]' diff --git a/release/src/router/busybox/testsuite/tr/tr-rejects-wrong-class b/release/src/router/busybox/testsuite/tr/tr-rejects-wrong-class new file mode 100644 index 00000000..97539360 --- /dev/null +++ b/release/src/router/busybox/testsuite/tr/tr-rejects-wrong-class @@ -0,0 +1,19 @@ +echo t12esting | tr -d '[[:alpha:]]' > logfile.gnu +echo t12esting | tr -d '[:alpha:]' >> logfile.gnu +echo t12esting | tr -d '[[:alpha:]' >> logfile.gnu +echo t12esting | tr -d '[[:alpha:' >> logfile.gnu +echo t12esting | tr -d '[[:alpha' >> logfile.gnu +echo t12esting | tr -d '[:alpha:]' >> logfile.gnu +echo t12esting | tr -d '[:alpha:' >> logfile.gnu +echo t12esting | tr -d '[:alpha' >> logfile.gnu + +echo t12esting | busybox tr -d '[[:alpha:]]' > logfile.bb +echo t12esting | busybox tr -d '[:alpha:]' >> logfile.bb +echo t12esting | busybox tr -d '[[:alpha:]' >> logfile.bb +echo t12esting | busybox tr -d '[[:alpha:' >> logfile.bb +echo t12esting | busybox tr -d '[[:alpha' >> logfile.bb +echo t12esting | busybox tr -d '[:alpha:]' >> logfile.bb +echo t12esting | busybox tr -d '[:alpha:' >> logfile.bb +echo t12esting | busybox tr -d '[:alpha' >> logfile.bb + +diff -u logfile.gnu logfile.bb diff --git a/release/src/router/busybox/testsuite/tr/tr-works b/release/src/router/busybox/testsuite/tr/tr-works new file mode 100644 index 00000000..2c0a9d19 --- /dev/null +++ b/release/src/router/busybox/testsuite/tr/tr-works @@ -0,0 +1,26 @@ +run_tr () +{ + echo -n "echo '$1' | tr '$2' '$3': " + echo "$1" | $bb tr "$2" "$3" + echo +} +tr_test () +{ + run_tr "cbaab" abc zyx + run_tr "TESTING A B C" '[A-Z]' '[a-z]' + run_tr "abc[]" "a[b" AXB + run_tr abc '[:alpha:]' A-ZA-Z + run_tr abc56 '[:alnum:]' A-ZA-Zxxxxxxxxxx + run_tr 012 '[:digit:]' abcdefghi + run_tr abc56 '[:lower:]' '[:upper:]' + run_tr " " '[:space:]' 12345 + run_tr " " '[:blank:]' 12 + run_tr 'a b' '[= =]' X + run_tr "[:" '[:' ab + run_tr " .,:" '[:punct:]' 12 + run_tr " .,:" '[:cntrl:]' 12 +} + +bb= tr_test > logfile.gnu +bb=busybox tr_test > logfile.bb +diff -u logfile.gnu logfile.bb |