Denis Vlasenko | 1bfcc8b | 2009-03-01 04:50:18 +0000 | [diff] [blame] | 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 | |
Mike Frysinger | caa7940 | 2009-11-04 18:41:22 -0500 | [diff] [blame] | 6 | . ./testing.sh |
Denis Vlasenko | 1bfcc8b | 2009-03-01 04:50:18 +0000 | [diff] [blame] | 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 | |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 18 | optional CONFIG_FEATURE_TR_CLASSES |
Denis Vlasenko | 1bfcc8b | 2009-03-01 04:50:18 +0000 | [diff] [blame] | 19 | testing "tr understands [:xdigit:]" \ |
| 20 | "tr -cd '[:xdigit:]'" \ |
| 21 | "19AF" "" "19AFH\n" |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 22 | SKIP= |
Denis Vlasenko | 1bfcc8b | 2009-03-01 04:50:18 +0000 | [diff] [blame] | 23 | |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 24 | optional CONFIG_FEATURE_TR_CLASSES |
Denis Vlasenko | 37ad6b3 | 2009-03-02 12:07:15 +0000 | [diff] [blame] | 25 | testing "tr does not stop after [:digit:]" \ |
| 26 | "tr '[:digit:]y-z' 111111111123" \ |
| 27 | "111abcx23\n" "" "789abcxyz\n" |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 28 | SKIP= |
Denis Vlasenko | 37ad6b3 | 2009-03-02 12:07:15 +0000 | [diff] [blame] | 29 | |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 30 | optional CONFIG_FEATURE_TR_CLASSES |
Denis Vlasenko | 37ad6b3 | 2009-03-02 12:07:15 +0000 | [diff] [blame] | 31 | testing "tr has correct xdigit sequence" \ |
| 32 | "tr '[:xdigit:]Gg' 1111111151242222333330xX" \ |
| 33 | "#1111111151242222x333330X\n" "" \ |
| 34 | "#0123456789ABCDEFGabcdefg\n" |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 35 | SKIP= |
Denis Vlasenko | 37ad6b3 | 2009-03-02 12:07:15 +0000 | [diff] [blame] | 36 | |
Denis Vlasenko | 1bfcc8b | 2009-03-01 04:50:18 +0000 | [diff] [blame] | 37 | exit $FAILCOUNT |