summaryrefslogtreecommitdiffstats
path: root/src/grep/tests/case-fold-backslash-w
blob: 57ff0f5424ddbb7f6ecce62ad75d0efe12018737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# test that \W works on case-insensitive matches.  It used to become \w.
# Derived from https://savannah.gnu.org/bugs/?28162
. "${srcdir=.}/init.sh"; path_prepend_ ../src

if echo foo bar | LANG=C.ASCII grep '^foo\W'; then
  echo foo bar | LANG=C.ASCII grep -i '^foo\W' || fail_ ASCII insensitive
else
  echo foo bar | LANG=C grep '^foo\W' || fail_ LANG=C sensitive
  echo foo bar | LANG=C grep -i '^foo\W' || fail_ LANG=C insensitive
fi
echo foo bar | LANG=en_US.UTF-8 grep '^foo\W' || fail_ UTF-8 sensitive
echo foo bar | LANG=en_US.UTF-8 grep -i '^foo\W' || fail_ UTF-8 insensitive