From 23c27aa22426b980a2bd8c68e013673e23051a3f Mon Sep 17 00:00:00 2001 From: lewie Date: Mon, 23 Apr 2001 19:25:06 +0000 Subject: [PATCH] [project @ 2001-04-23 19:25:06 by lewie] Adding tests for infix decls w/ infix data constructors --- ghc/tests/reader/should_compile/read030.hs | 10 ++++++++++ ghc/tests/reader/should_fail/read016.hs | 7 +++++++ ghc/tests/reader/should_fail/read016.stderr | 4 ++++ ghc/tests/reader/should_fail/read016.stdout | 7 +++++++ 4 files changed, 28 insertions(+) create mode 100644 ghc/tests/reader/should_compile/read030.hs create mode 100644 ghc/tests/reader/should_fail/read016.hs create mode 100644 ghc/tests/reader/should_fail/read016.stderr create mode 100644 ghc/tests/reader/should_fail/read016.stdout diff --git a/ghc/tests/reader/should_compile/read030.hs b/ghc/tests/reader/should_compile/read030.hs new file mode 100644 index 0000000..2688302 --- /dev/null +++ b/ghc/tests/reader/should_compile/read030.hs @@ -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 index 0000000..493606a --- /dev/null +++ b/ghc/tests/reader/should_fail/read016.hs @@ -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 index 0000000..0372411 --- /dev/null +++ b/ghc/tests/reader/should_fail/read016.stderr @@ -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 index 0000000..7c7f529 --- /dev/null +++ b/ghc/tests/reader/should_fail/read016.stdout @@ -0,0 +1,7 @@ + +==================== Parser ==================== +module ShouldFail where +|- ps q : qs = undefined +infix 6 |- + + -- 1.7.10.4