Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 1 | # FEATURE: CONFIG_FEATURE_TR_CLASSES |
| 2 | |
Rob Landley | 998dbee | 2006-04-19 22:22:06 +0000 | [diff] [blame] | 3 | run_tr () |
| 4 | { |
Denys Vlasenko | e82cf33 | 2010-05-12 15:59:32 +0200 | [diff] [blame] | 5 | $ECHO -n "echo '$1' | tr '$2' '$3': " |
Rob Landley | 998dbee | 2006-04-19 22:22:06 +0000 | [diff] [blame] | 6 | echo "$1" | $bb tr "$2" "$3" |
| 7 | echo |
| 8 | } |
| 9 | tr_test () |
| 10 | { |
| 11 | run_tr "cbaab" abc zyx |
Denis Vlasenko | 9213a9e | 2006-09-17 16:28:10 +0000 | [diff] [blame] | 12 | run_tr "TESTING A B C" '[A-Z]' '[a-z]' |
Rob Landley | 998dbee | 2006-04-19 22:22:06 +0000 | [diff] [blame] | 13 | run_tr "abc[]" "a[b" AXB |
| 14 | run_tr abc '[:alpha:]' A-ZA-Z |
| 15 | run_tr abc56 '[:alnum:]' A-ZA-Zxxxxxxxxxx |
| 16 | run_tr 012 '[:digit:]' abcdefghi |
| 17 | run_tr abc56 '[:lower:]' '[:upper:]' |
| 18 | run_tr " " '[:space:]' 12345 |
| 19 | run_tr " " '[:blank:]' 12 |
| 20 | run_tr 'a b' '[= =]' X |
| 21 | run_tr "[:" '[:' ab |
Bernhard Reutner-Fischer | eceecea | 2007-03-30 14:43:27 +0000 | [diff] [blame] | 22 | run_tr " .,:" '[:punct:]' 12 |
| 23 | run_tr " .,:" '[:cntrl:]' 12 |
Rob Landley | 998dbee | 2006-04-19 22:22:06 +0000 | [diff] [blame] | 24 | } |
Eric Andersen | 650fe63 | 2004-04-06 11:10:30 +0000 | [diff] [blame] | 25 | |
Rob Landley | 998dbee | 2006-04-19 22:22:06 +0000 | [diff] [blame] | 26 | bb= tr_test > logfile.gnu |
| 27 | bb=busybox tr_test > logfile.bb |
Bernhard Reutner-Fischer | eceecea | 2007-03-30 14:43:27 +0000 | [diff] [blame] | 28 | diff -u logfile.gnu logfile.bb |