summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/testsuite/tr.tests
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
commit4aca87515a5083ae0e31ce3177189fd43b6d05ac (patch)
tree7b1d9a31393ca090757dc6f0d3859b4fcd93f271 /release/src/router/busybox/testsuite/tr.tests
parent008d0be72b2f160382c6e880765e96b64a050c65 (diff)
downloadtomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.gz
tomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.bz2
patch to Vanilla Tomato 1.28
Diffstat (limited to 'release/src/router/busybox/testsuite/tr.tests')
-rw-r--r--release/src/router/busybox/testsuite/tr.tests31
1 files changed, 31 insertions, 0 deletions
diff --git a/release/src/router/busybox/testsuite/tr.tests b/release/src/router/busybox/testsuite/tr.tests
new file mode 100644
index 00000000..f91cc1f6
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tr.tests
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+# testing "description" "arguments" "result" "infile" "stdin"
+
+testing "tr does not treat [] in [a-z] as special" \
+ "tr '[q-z]' '_Q-Z+'" \
+ "_QWe+" "" "[qwe]"
+
+testing "tr understands 0-9A-F" \
+ "tr -cd '[0-9A-F]'" \
+ "19AF" "" "19AFH\n"
+
+testing "tr understands [:xdigit:]" \
+ "tr -cd '[:xdigit:]'" \
+ "19AF" "" "19AFH\n"
+
+testing "tr does not stop after [:digit:]" \
+ "tr '[:digit:]y-z' 111111111123" \
+ "111abcx23\n" "" "789abcxyz\n"
+
+testing "tr has correct xdigit sequence" \
+ "tr '[:xdigit:]Gg' 1111111151242222333330xX" \
+ "#1111111151242222x333330X\n" "" \
+ "#0123456789ABCDEFGabcdefg\n"
+
+exit $FAILCOUNT