[commit: ghc] master: testsuite: Add test for #11959 (4f2afe1)

git at git.haskell.org git at git.haskell.org
Wed May 4 13:02:06 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4f2afe1e674606230f2dc2f8ce040a2bd345a647/ghc

>---------------------------------------------------------------

commit 4f2afe1e674606230f2dc2f8ce040a2bd345a647
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue May 3 22:58:47 2016 +0200

    testsuite: Add test for #11959
    
    Test Plan: Validate, expected to fail
    
    Reviewers: goldfire, austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2132
    
    GHC Trac Issues: #11959


>---------------------------------------------------------------

4f2afe1e674606230f2dc2f8ce040a2bd345a647
 testsuite/tests/patsyn/should_compile/T11959.hs     |  6 ++++++
 testsuite/tests/patsyn/should_compile/T11959.stdout |  3 +++
 testsuite/tests/patsyn/should_compile/T11959Lib.hs  | 11 +++++++++++
 testsuite/tests/patsyn/should_compile/all.T         |  1 +
 4 files changed, 21 insertions(+)

diff --git a/testsuite/tests/patsyn/should_compile/T11959.hs b/testsuite/tests/patsyn/should_compile/T11959.hs
new file mode 100644
index 0000000..ccff2e0
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T11959.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE PatternSynonyms #-}
+module Main where
+
+import T11959Lib (Vec2(..), pattern (:>))
+
+main = return ()
diff --git a/testsuite/tests/patsyn/should_compile/T11959.stdout b/testsuite/tests/patsyn/should_compile/T11959.stdout
new file mode 100644
index 0000000..01c0f01
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T11959.stdout
@@ -0,0 +1,3 @@
+
+T11959Lib.hs:2:35: warning: [-Wduplicate-exports (in -Wdefault)]
+    ‘:>’ is exported by ‘(:>)’ and ‘Vec2(Nil, type (:>))’
diff --git a/testsuite/tests/patsyn/should_compile/T11959Lib.hs b/testsuite/tests/patsyn/should_compile/T11959Lib.hs
new file mode 100644
index 0000000..4c00721
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T11959Lib.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE PatternSynonyms, ViewPatterns #-}
+module T11959Lib (Vec2(Nil,(:>)), pattern (:>)) where
+
+newtype Vec2 a = Vec2 {unvec2 :: [a]}
+
+pattern Nil :: Vec2 a
+pattern Nil = Vec2 []
+
+pattern (:>) x xs <- ((\ys -> (head $ unvec2 ys,Vec2 . tail $ unvec2 ys)) -> (x,xs))
+  where
+    (:>) x xs = Vec2 (x:unvec2 xs)
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 3032096..d2f6809 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -52,3 +52,4 @@ test('T11336', normal, compile, [''])
 test('T11367', normal, compile, [''])
 test('T11351', normal, compile, [''])
 test('T11633', normal, compile, [''])
+test('T11959', expect_broken(11959), multimod_compile, ['T11959', '-v0'])
\ No newline at end of file



More information about the ghc-commits mailing list