Debian Codegraph @

tests/pcre-utf8-bug224

raw
1 #!/bin/sh
2 # Ensure negated Perl classes match multibyte characters in UTF mode.
3 #
4 # Copyright (C) 2023-2025 Free Software Foundation, Inc.
5 #
6 # Copying and distribution of this file, with or without modification,
7 # are permitted in any medium without royalty provided the copyright
8 # notice and this notice are preserved.
9
10 . "${srcdir=.}/init.sh"; path_prepend_ ../src
11 require_en_utf8_locale_
12 LC_ALL=en_US.UTF-8
13 export LC_ALL
14 require_pcre_
15
16 echo . | grep -qP '(*UTF).' 2>/dev/null \
17 || skip_ 'PCRE unicode support is compiled out'
18
19 fail=0
20
21 # 'ñ' - U+00F1 LATIN SMALL LETTER N WITH TILDE
22 printf '\302\221\n' > in || framework_failure_
23 grep -P '\D' in > out || fail=1
24 compare in out || fail=1
25
26 # '𝄞' - U+1D11E MUSICAL SYMBOL G CLEF
27 printf '\360\235\204\236\n' > in || framework_failure_
28 grep -P '\W' in > out || fail=1
29 compare in out || fail=1
30
31 Exit $fail