tr: support [:xdigit:], fix handling of ranges and [x]'s.
[oweals/busybox.git] / testsuite / tr.tests
1 #!/bin/sh
2
3 # Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
4 # Licensed under GPL v2, see file LICENSE for details.
5
6 . testing.sh
7
8 # testing "description" "arguments" "result" "infile" "stdin"
9
10 testing "tr does not treat [] in [a-z] as special" \
11         "tr '[q-z]' '_Q-Z+'" \
12         "_QWe+" "" "[qwe]"
13
14 testing "tr understands 0-9A-F" \
15         "tr -cd '[0-9A-F]'" \
16         "19AF" "" "19AFH\n"
17
18 testing "tr understands [:xdigit:]" \
19         "tr -cd '[:xdigit:]'" \
20         "19AF" "" "19AFH\n"
21
22 exit $FAILCOUNT