2009-03-01 04:50:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
|
|
|
|
# Licensed under GPL v2, see file LICENSE for details.
|
|
|
|
|
2009-11-04 23:41:22 +00:00
|
|
|
. ./testing.sh
|
2009-03-01 04:50:18 +00:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
2010-07-29 07:05:30 +00:00
|
|
|
optional FEATURE_TR_CLASSES
|
2009-03-01 04:50:18 +00:00
|
|
|
testing "tr understands [:xdigit:]" \
|
|
|
|
"tr -cd '[:xdigit:]'" \
|
|
|
|
"19AF" "" "19AFH\n"
|
2010-05-11 01:53:57 +00:00
|
|
|
SKIP=
|
2009-03-01 04:50:18 +00:00
|
|
|
|
2010-07-29 07:05:30 +00:00
|
|
|
optional FEATURE_TR_CLASSES
|
2009-03-02 12:07:15 +00:00
|
|
|
testing "tr does not stop after [:digit:]" \
|
|
|
|
"tr '[:digit:]y-z' 111111111123" \
|
|
|
|
"111abcx23\n" "" "789abcxyz\n"
|
2010-05-11 01:53:57 +00:00
|
|
|
SKIP=
|
2009-03-02 12:07:15 +00:00
|
|
|
|
2010-07-29 07:05:30 +00:00
|
|
|
optional FEATURE_TR_CLASSES
|
2009-03-02 12:07:15 +00:00
|
|
|
testing "tr has correct xdigit sequence" \
|
|
|
|
"tr '[:xdigit:]Gg' 1111111151242222333330xX" \
|
|
|
|
"#1111111151242222x333330X\n" "" \
|
|
|
|
"#0123456789ABCDEFGabcdefg\n"
|
2010-05-11 01:53:57 +00:00
|
|
|
SKIP=
|
2009-03-02 12:07:15 +00:00
|
|
|
|
2009-03-01 04:50:18 +00:00
|
|
|
exit $FAILCOUNT
|