mirror of
https://https.git.savannah.gnu.org/git/diffutils.git
synced 2026-01-27 18:04:32 +00:00
* bootstrap.conf (gnulib_modules): Add c32isspace, c32tolower. * lib/Makefile.am (noinst_HEADERS): Add mbcel.h. (libdiffutils_a_SOURCES): Add mbcel.c * lib/mbcel.c, lib/mbcel.h: New files. * src/io.c: Include mbcel.h, uchar.h. (hash): 2nd arg is now hash_value, not merely unsigned char, since the caller might pass a char32_t now. (find_and_hash_each_line): Support multi-byte input. * src/util.c: Include mbcel.h, uchar.h. (lines_differ): New args S1LEN, S2LEN, needed for mbcel_scan. Caller changed. Support multi-byte input. * tests/ignore-case: New file. * tests/Makefile.am (TESTS): Add it. * tests/ignore-tab-expansion: Add UTF-8 test. * tests/init.cfg (require_utf8_locale_): New function. * tests/side-by-side: Use it. Add a column-counting test.
53 lines
1.2 KiB
Bash
Executable File
53 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
||
# Test side-by-side output with non-ASCII characters.
|
||
|
||
. "${srcdir=.}/init.sh"; path_prepend_ ../src
|
||
require_utf8_locale_
|
||
|
||
fail=0
|
||
|
||
cat >in1 <<\EOF || framework_failure_
|
||
a
|
||
ab
|
||
abc
|
||
[一天早上,當格雷戈爾·薩姆沙從不安的夢中醒來時,
|
||
他發現自己在床上變成了一隻可怕的害蟲。
|
||
]
|
||
EOF
|
||
|
||
cat >in2 <<\EOF || framework_failure_
|
||
ab
|
||
abcd
|
||
<一天早上,當格雷戈爾·薩姆沙從不安的夢中醒來時,
|
||
他發現自己在床上變成了一隻可怕的害蟲。
|
||
>
|
||
EOF
|
||
|
||
tr '_@' ' \t' >exp <<'EOF' || framework_failure_
|
||
a@@_____<
|
||
ab@@@ab
|
||
abc@@_____|@abcd
|
||
[一天早上,當格雷戈__|@<一天早上,當格雷戈
|
||
_他發現自己在床上變@_他發現自己在床上變
|
||
]@@_____|@>
|
||
EOF
|
||
|
||
returns_ 1 diff -y -W 44 in1 in2 >out 2>err || fail=1
|
||
compare exp out || fail=1
|
||
compare /dev/null err || fail=1
|
||
|
||
cat >exp <<'EOF' || framework_failure_
|
||
a <
|
||
ab ab
|
||
abc | abcd
|
||
[一天早上,當格雷戈 | <一天早上,當格雷戈
|
||
他發現自己在床上變 他發現自己在床上變
|
||
] | >
|
||
EOF
|
||
|
||
returns_ 1 diff --expand-tabs -y -W 44 in1 in2 >out 2>err || fail=1
|
||
compare exp out || fail=1
|
||
compare /dev/null err || fail=1
|
||
|
||
Exit $fail
|