2 # Copyright 2008 by Denys Vlasenko
3 # Licensed under GPLv2, see file LICENSE in this source tree.
6 test -f "$bindir/.config" && . "$bindir/.config"
8 # testing "test name" "options" "expected result" "file input" "stdin"
10 testing "unexpand case 1" "unexpand" \
11 "\t12345678\n" "" " 12345678\n" \
13 testing "unexpand case 2" "unexpand" \
14 "\t 12345678\n" "" " 12345678\n" \
16 testing "unexpand case 3" "unexpand" \
17 "\t 12345678\n" "" " 12345678\n" \
19 testing "unexpand case 4" "unexpand" \
20 "\t12345678\n" "" " \t12345678\n" \
22 testing "unexpand case 5" "unexpand" \
23 "\t12345678\n" "" " \t12345678\n" \
25 testing "unexpand case 6" "unexpand" \
26 "\t12345678\n" "" " \t12345678\n" \
28 testing "unexpand case 7" "unexpand" \
29 "123\t 45678\n" "" "123 \t 45678\n" \
31 testing "unexpand case 8" "unexpand" \
36 testing "unexpand flags $*" "unexpand $*" \
40 # tabs=8, Convert only leading sequences of blanks
46 testcase -t8 --first-only
48 # tabs=8, Convert all blanks
54 # tabs=4, Convert all blanks
60 # tabs=4, Convert only leading sequences of blanks
64 testcase -t4 --first-only
65 testcase --first-only -t4
67 test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
68 && test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
69 && testing "unexpand with unicode characher 0x394" "unexpand" \
70 "1ΔΔΔ5\t99999\n" "" "1ΔΔΔ5 99999\n"