Debian Codegraph @

tests/case-fold-backslash-w

raw
1 #!/bin/sh
2 # test that \W works on case-insensitive matches. It used to become \w.
3 # Derived from https://savannah.gnu.org/bugs/?28162
4 . "${srcdir=.}/init.sh"; path_prepend_ ../src
5
6 if echo foo bar | LANG=C.ASCII grep '^foo\W'; then
7 echo foo bar | LANG=C.ASCII grep -i '^foo\W' || fail_ ASCII insensitive
8 else
9 echo foo bar | LANG=C grep '^foo\W' || fail_ LANG=C sensitive
10 echo foo bar | LANG=C grep -i '^foo\W' || fail_ LANG=C insensitive
11 fi
12 echo foo bar | LANG=en_US.UTF-8 grep '^foo\W' || fail_ UTF-8 sensitive
13 echo foo bar | LANG=en_US.UTF-8 grep -i '^foo\W' || fail_ UTF-8 insensitive