Tomato 1.28
[tomato.git] / release / src / router / busybox / testsuite / tr.tests
blobf91cc1f657462cb77855388a2a0a1fd1e8130c42
1 #!/bin/sh
3 # Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
4 # Licensed under GPL v2, see file LICENSE for details.
6 . testing.sh
8 # testing "description" "arguments" "result" "infile" "stdin"
10 testing "tr does not treat [] in [a-z] as special" \
11 "tr '[q-z]' '_Q-Z+'" \
12 "_QWe+" "" "[qwe]"
14 testing "tr understands 0-9A-F" \
15 "tr -cd '[0-9A-F]'" \
16 "19AF" "" "19AFH\n"
18 testing "tr understands [:xdigit:]" \
19 "tr -cd '[:xdigit:]'" \
20 "19AF" "" "19AFH\n"
22 testing "tr does not stop after [:digit:]" \
23 "tr '[:digit:]y-z' 111111111123" \
24 "111abcx23\n" "" "789abcxyz\n"
26 testing "tr has correct xdigit sequence" \
27 "tr '[:xdigit:]Gg' 1111111151242222333330xX" \
28 "#1111111151242222x333330X\n" "" \
29 "#0123456789ABCDEFGabcdefg\n"
31 exit $FAILCOUNT