Skip to content
Snippets Groups Projects
Commit e305e60c authored by Matthew Farkas-Dyck's avatar Matthew Farkas-Dyck :musical_note: Committed by Marge Bot
Browse files

Unbreak some tests with latest GNU grep, which now warns about stray '\'.

Confusingly, the testsuite mangled the error to say "stray /".

We also migrate some tests from grep to grep -E, as it seems the author actually wanted an "POSIX extended" (a.k.a. sane) regex.

Background: POSIX specifies 2 "regex" syntaxen: "basic" and "extended". Of these, only "extended" syntax is actually a regular expression. Furthermore, "basic" syntax is inconsistent in its use of the '\' character — sometimes it escapes a regex metacharacter, but sometimes it unescapes it, i.e. it makes an otherwise normal character become a metacharacter. This baffles me and it seems also the authors of these tests. Also, the regex(7) man page (at least on Linux) says "basic" syntax is obsolete. Nearly all modern tools and libraries are consistent in this use of the '\' character (of which many use "extended" syntax by default).
parent 5b9e9300
No related branches found
No related tags found
No related merge requests found
......@@ -52,9 +52,9 @@ T11004:
T12504:
'$(HSC2HS)' $(HSC2HS_OPTS) T12504/path/to/$@.hsc
ifeq "$(WINDOWS)" "YES"
grep '{-# LINE 1 \"T12504\\\\path\\\\to\\\\$@\.hsc\" #-}' T12504/path/to/$@.hs
grep '{-# LINE 1 "T12504\\\\path\\\\to\\\\$@\.hsc" #-}' T12504/path/to/$@.hs
else
grep '{-# LINE 1 \"T12504/path/to/$@\.hsc\" #-}' T12504/path/to/$@.hs
grep '{-# LINE 1 "T12504/path/to/$@\.hsc" #-}' T12504/path/to/$@.hs
endif
.PHONY: T15758
......
......@@ -6,5 +6,5 @@ include $(TOP)/mk/test.mk
T7014:
rm -f T7014.simpl T7014.o T7014.hi
'$(TEST_HC)' -Wall -v0 -O --make T7014.hs -fforce-recomp -ddump-simpl > T7014.simpl
! grep -q -f T7014.primops T7014.simpl
! grep -Eq -f T7014.primops T7014.simpl
./T7014
......@@ -2,7 +2,7 @@ and#
or#
uncheckedShift.*#
\+#
\-#
-#
\*#
quotInt#
remInt#
......
......@@ -254,7 +254,7 @@ str-rules:
# g should have been collapsed into one defininition by CSE.
.PHONY: T13340
T13340:
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#'
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -Ec '\+#'
# We expect to see all dictionaries specialized away.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment