VirtualBox

source: kBuild/trunk/src/grep/tests/word-delim-multibyte

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/sh
2# exercise \< and \> with multibyte data.
3# Derived from https://savannah.gnu.org/bugs/?29537
4. "${srcdir=.}/init.sh"; path_prepend_ ../src
5
6require_en_utf8_locale_
7
8e_acute=$(printf '\303\251')
9echo "$e_acute" > in || framework_failure_
10LC_ALL=en_US.UTF-8
11export LC_ALL
12
13fail=0
14
15grep "\\<$e_acute" in > out 2>err || fail=1
16compare out in || fail=1
17compare /dev/null err || fail=1
18
19grep "$e_acute\\>" in > out 2>err || fail=1
20compare out in || fail=1
21compare /dev/null err || fail=1
22
23grep -w "$e_acute" in > out 2>err || fail=1
24compare out in || fail=1
25compare /dev/null err || fail=1
26
27# Also ensure that this works in both the C locale and that multibyte one.
28# In the C locale, it failed due to a dfa.c regression in grep-3.2.
29echo 123-x > in || framework_failure_
30
31for locale in C en_US.UTF-8; do
32 LC_ALL=$locale grep '.\bx' in > out 2>err || fail=1
33 compare out in || fail=1
34 compare /dev/null err || fail=1
35done
36
37# Bug#43255
38printf 'a \303\255cone b\n' >in
39for flag in '' -i; do
40 returns_ 1 env LC_ALL=en_US.UTF-8 grep -w $flag cone in >out 2>err || fail=1
41 compare /dev/null out || fail=1
42 compare /dev/null err || fail=1
43done
44
45Exit $fail
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette