Debian Codegraph @

tests/prefix-of-multibyte

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 # This would mistakenly print a line prior to grep-2.18.
3 . "${srcdir=.}/init.sh"; path_prepend_ ../src
4
5 require_en_utf8_locale_
6 require_compiled_in_MB_support
7
8 encodescip-shell shell grep 3.12-1 encode().() { echoscip-shell system . . echo. "$1" | trscip-shell system . . tr. ABC '\357\274\241'; }
9
10 encodescip-shell shell grep 3.12-1 encode(). ABC >exp1
11 encodescip-shell shell grep 3.12-1 encode(). aABC >exp2
12 encodescip-shell shell grep 3.12-1 encode(). ABCABC >exp3
13 encodescip-shell shell grep 3.12-1 encode(). _____________________ABCABC___ >exp4
14
15 fail=0
16
17 for LOC in en_US.UTF-8 $LOCALE_FR_UTF8; do
18 for pat in A aA BCA; do
19 for file in exp1 exp2 exp3 exp4; do
20 for type in regex dfa fgrep; do
21 case $type in
22 dfa) opt= prefix= ;;
23 fgrep) opt=-F prefix= ;;
24 regex) opt= prefix='\(\)\1' ;;
25 esac
26 pattern=$prefix$(encodescip-shell shell grep 3.12-1 encode(). $pat)
27 out=out-$type-$LOC
28 LC_ALL=$LOC grepscip-shell system . . grep. $opt "$pattern" $file >$out
29 status=$?
30 echoscip-shell system . . echo. $status >$out.status
31 if testscip-shell system . . test. $status -eq 0; then
32 compare $file $out
33 elif testscip-shell system . . test. $status -eq 1; then
34 compare_dev_null_ /dev/nullscip-shell filesystem . . `/dev/null`. $out
35 else
36 testscip-shell system . . test. $status -eq 2
37 fi || fail=1
38 compare out-regex-$LOC.status $out.status || fail=1
39 done
40 done
41 done
42 done
43
44 Exit $fail