2 # test that matches starting in the middle of a multibyte char aren't rejected
4 # Derived from https://savannah.gnu.org/bugs/?23814
5 .
"${srcdir=.}/init.sh"; path_prepend_ ..
/src
7 # Add "." to PATH for the use of get-mb-cur-max.
10 require_compiled_in_MB_support
15 echo "$1" |
tr AB
'\244\263'
19 pat
=$
(make_input
"$1")
20 LC_ALL
=$locale grep "$pat"
23 case $
(get-mb-cur-max
$locale) in
25 *) skip_
'EUC-JP locale not found' ;;
30 # Does EUC-JP work at all?
31 make_input BABA |euc_grep AB
&& fail
=1
33 # Here are two cases in which a KWSet search matches in the middle
34 # of a multibyte character. The first ensures that the DFA matcher
35 # finds the real match at the end of line. The second ensures that
36 # while the KWSet match found a false positive, the DFA matcher
37 # determines there is no match after all.
38 make_input BABAAB |euc_grep AB
> out || fail
=1
39 make_input BABAAB
> exp || framework_failure_
40 compare exp out || fail
=1
41 make_input BABABA |returns_
1 euc_grep AB || fail
=1
42 make_input BABABA |returns_
1 euc_grep
'^x\|AB' || fail
=1
44 # -P supports only unibyte and UTF-8 locales.
45 returns_
2 env LC_ALL
=$locale grep -P x
/dev
/null || fail
=1