Skip to content

Commit

Permalink
test: use a fully spec locale name in RunGrepTest
Browse files Browse the repository at this point in the history
A locale contains an optional charmap that might be relevant in
determining if the setlocale() function considers it valid.

Change the bad locale used when testing to one that contains also
an invalid charmap and therefore fix this test in OpenBSD.
  • Loading branch information
carenas committed Jun 18, 2024
1 parent 3b90149 commit aec5d8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions RunGrepTest
Original file line number Diff line number Diff line change
Expand Up @@ -842,11 +842,11 @@ echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 150 -----------------------------" >>testtrygrep
which locale >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "pcre2grep: Failed to set locale badlocale (obtained from LC_CTYPE)" >>testtrygrep
echo "pcre2grep: Failed to set locale locale.bad (obtained from LC_CTYPE)" >>testtrygrep
echo "RC=2" >>testtrygrep
else

(cd $srcdir; unset LC_ALL; env LC_CTYPE=badlocale $valgrind $vjs $pcre2grep abc /dev/null) >>testtrygrep 2>&1
(cd $srcdir; unset LC_ALL; env LC_CTYPE=locale.bad $valgrind $vjs $pcre2grep abc /dev/null) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
fi

Expand Down
2 changes: 1 addition & 1 deletion testdata/grepoutput
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ Usage: pcre2grep [-AaBCcDdEeFfHhIilLMmNnOoPqrstuUVvwxZ] [long options] [pattern]
Type "pcre2grep --help" for more information and the long options.
RC=2
---------------------------- Test 150 -----------------------------
pcre2grep: Failed to set locale badlocale (obtained from LC_CTYPE)
pcre2grep: Failed to set locale locale.bad (obtained from LC_CTYPE)
RC=2
---------------------------- Test 151 -----------------------------
The quick brown
Expand Down

0 comments on commit aec5d8b

Please sign in to comment.