[project @ 2001-04-23 19:25:06 by lewie]
authorlewie <unknown>
Mon, 23 Apr 2001 19:25:06 +0000 (19:25 +0000)
committerlewie <unknown>
Mon, 23 Apr 2001 19:25:06 +0000 (19:25 +0000)
Adding tests for infix decls w/ infix data constructors

ghc/tests/reader/should_compile/read030.hs [new file with mode: 0644]
ghc/tests/reader/should_fail/read016.hs [new file with mode: 0644]
ghc/tests/reader/should_fail/read016.stderr [new file with mode: 0644]
ghc/tests/reader/should_fail/read016.stdout [new file with mode: 0644]

diff --git a/ghc/tests/reader/should_compile/read030.hs b/ghc/tests/reader/should_compile/read030.hs
new file mode 100644 (file)
index 0000000..2688302
--- /dev/null
@@ -0,0 +1,10 @@
+-- !!! Infix decls w/ infix data constructors
+
+-- GHC used to barf on this...
+
+module ShouldCompile where
+
+infix 2 |-, |+
+
+ps  |-  q:qs   = undefined
+ps  |+  p:q:qs = undefined
diff --git a/ghc/tests/reader/should_fail/read016.hs b/ghc/tests/reader/should_fail/read016.hs
new file mode 100644 (file)
index 0000000..493606a
--- /dev/null
@@ -0,0 +1,7 @@
+-- !!! Infix decls w/ infix data constructors
+
+module ShouldFail where
+
+infix 6 |-
+
+ps  |-  q:qs   = undefined
diff --git a/ghc/tests/reader/should_fail/read016.stderr b/ghc/tests/reader/should_fail/read016.stderr
new file mode 100644 (file)
index 0000000..0372411
--- /dev/null
@@ -0,0 +1,4 @@
+
+read016.hs:7:
+    precedence parsing error
+       cannot mix `|-' [infix 6] and `:' [infixr 5] in the same infix expression
diff --git a/ghc/tests/reader/should_fail/read016.stdout b/ghc/tests/reader/should_fail/read016.stdout
new file mode 100644 (file)
index 0000000..7c7f529
--- /dev/null
@@ -0,0 +1,7 @@
+
+==================== Parser ====================
+module ShouldFail where
+|- ps q : qs = undefined
+infix 6 |-
+
+