summaryrefslogtreecommitdiff
path: root/testsuite/tr
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tr')
-rw-r--r--testsuite/tr/tr-d-alnum-works4
-rw-r--r--testsuite/tr/tr-d-works2
-rw-r--r--testsuite/tr/tr-rejects-wrong-class19
-rw-r--r--testsuite/tr/tr-works4
4 files changed, 27 insertions, 2 deletions
diff --git a/testsuite/tr/tr-d-alnum-works b/testsuite/tr/tr-d-alnum-works
new file mode 100644
index 0000000..d440f8f
--- /dev/null
+++ b/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/testsuite/tr/tr-d-works b/testsuite/tr/tr-d-works
index d939e8b..a86bfbd 100644
--- a/testsuite/tr/tr-d-works
+++ b/testsuite/tr/tr-d-works
@@ -1,4 +1,4 @@
echo testing | tr -d aeiou > logfile.gnu
echo testing | busybox tr -d aeiou > logfile.bb
-cmp logfile.gnu logfile.bb
+diff -u logfile.gnu logfile.bb
diff --git a/testsuite/tr/tr-rejects-wrong-class b/testsuite/tr/tr-rejects-wrong-class
new file mode 100644
index 0000000..9753936
--- /dev/null
+++ b/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/testsuite/tr/tr-works b/testsuite/tr/tr-works
index 9b2e90e..2c0a9d1 100644
--- a/testsuite/tr/tr-works
+++ b/testsuite/tr/tr-works
@@ -17,8 +17,10 @@ tr_test ()
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
-cmp logfile.gnu logfile.bb
+diff -u logfile.gnu logfile.bb