blob: 7b326dc2cb0901d113b0fe6348d942c48cccccc6 [file] [log] [blame]
Denis Vlasenkoe40e76f2008-12-26 14:56:03 +00001#!/bin/sh
2# Copyright 2008 by Denys Vlasenko
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003# Licensed under GPLv2, see file LICENSE in this source tree.
Denis Vlasenkoe40e76f2008-12-26 14:56:03 +00004
Mike Frysingercaa79402009-11-04 18:41:22 -05005. ./testing.sh
Denys Vlasenko9297dbc2010-07-05 21:37:12 +02006test -f "$bindir/.config" && . "$bindir/.config"
Denis Vlasenkoe40e76f2008-12-26 14:56:03 +00007
8# testing "test name" "options" "expected result" "file input" "stdin"
9
10testing "unexpand case 1" "unexpand" \
11 "\t12345678\n" "" " 12345678\n" \
12
13testing "unexpand case 2" "unexpand" \
14 "\t 12345678\n" "" " 12345678\n" \
15
16testing "unexpand case 3" "unexpand" \
17 "\t 12345678\n" "" " 12345678\n" \
18
19testing "unexpand case 4" "unexpand" \
20 "\t12345678\n" "" " \t12345678\n" \
21
22testing "unexpand case 5" "unexpand" \
23 "\t12345678\n" "" " \t12345678\n" \
24
25testing "unexpand case 6" "unexpand" \
26 "\t12345678\n" "" " \t12345678\n" \
27
28testing "unexpand case 7" "unexpand" \
29 "123\t 45678\n" "" "123 \t 45678\n" \
30
Tomas Heinrich968951f2010-03-26 09:46:07 +010031testing "unexpand case 8" "unexpand" \
32 "a b\n" "" "a b\n" \
33
Denys Vlasenko9297dbc2010-07-05 21:37:12 +020034test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
35&& test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
Denys Vlasenkoee1f19b2010-07-06 02:20:00 +020036&& testing "unexpand with unicode characher 0x394" "unexpand" \
Denys Vlasenkoe3d90a92010-05-10 05:53:16 +020037 "1ΔΔΔ5\t99999\n" "" "1ΔΔΔ5 99999\n"
Tomas Heinrichd2b1ba62010-01-04 16:21:31 +010038
Denis Vlasenkoe40e76f2008-12-26 14:56:03 +000039exit $FAILCOUNT