summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Farkas-Dyck <m@farkas-dyck.ca>2023-05-11 12:11:37 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-15 11:27:41 -0400
commite305e60cf507808fa31c456ef98295f8f7d00c9d (patch)
tree3e8469b0b7c408d0bb40b144747ffdba8a59895b
parent5b9e9300c3766a3ef4b19a2274ecc6e8c56fe86c (diff)
downloadhaskell-e305e60cf507808fa31c456ef98295f8f7d00c9d.tar.gz
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).
-rw-r--r--testsuite/tests/hsc2hs/Makefile4
-rw-r--r--testsuite/tests/numeric/should_run/Makefile2
-rw-r--r--testsuite/tests/numeric/should_run/T7014.primops2
-rw-r--r--testsuite/tests/simplCore/should_compile/Makefile2
4 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/hsc2hs/Makefile b/testsuite/tests/hsc2hs/Makefile
index d0b2d249c3..95b011c85d 100644
--- a/testsuite/tests/hsc2hs/Makefile
+++ b/testsuite/tests/hsc2hs/Makefile
@@ -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
diff --git a/testsuite/tests/numeric/should_run/Makefile b/testsuite/tests/numeric/should_run/Makefile
index 26ec990fee..23f4456dca 100644
--- a/testsuite/tests/numeric/should_run/Makefile
+++ b/testsuite/tests/numeric/should_run/Makefile
@@ -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
diff --git a/testsuite/tests/numeric/should_run/T7014.primops b/testsuite/tests/numeric/should_run/T7014.primops
index 3243666dbc..8277db5c32 100644
--- a/testsuite/tests/numeric/should_run/T7014.primops
+++ b/testsuite/tests/numeric/should_run/T7014.primops
@@ -2,7 +2,7 @@ and#
or#
uncheckedShift.*#
\+#
-\-#
+-#
\*#
quotInt#
remInt#
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
index ffc56f8ee4..0583cb496e 100644
--- a/testsuite/tests/simplCore/should_compile/Makefile
+++ b/testsuite/tests/simplCore/should_compile/Makefile
@@ -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.