@@ -1095,8 +1095,8 @@ fillTypedHoleTests = let
10951095
10961096addSigActionTests :: TestTree
10971097addSigActionTests = let
1098− header = "{-# OPTIONS_GHC -Wmissing-signatures #-}"
1099− moduleH = "module Sigs where"
1098+ header = "{-# OPTIONS_GHC -Wmissing-signatures -Wmissing-pattern-synonym-signatures #-}"
1099+ moduleH = "{-# LANGUAGE PatternSynonyms #-}\nmodule Sigs where"
11001100 before def = T.unlines [header, moduleH, def]
11011101 after' def sig = T.unlines [header, moduleH, sig, def]
11021102
@@ -1112,19 +1112,20 @@ addSigActionTests = let
11121112 liftIO $ expectedCode @=? modifiedCode
11131113 in
11141114 testGroup "add signature"
1115− [ "abc = True" >:: "abc :: Bool"
1116− , "foo a b = a + b" >:: "foo :: Num a => a -> a -> a"
1117− , "bar a b = show $ a + b" >:: "bar :: (Show a, Num a) => a -> a -> String"
1118− , "(!!!) a b = a > b" >:: "(!!!) :: Ord a => a -> a -> Bool"
1119− , "a >>>> b = a + b" >:: "(>>>>) :: Num a => a -> a -> a"
1120− , "a `haha` b = a b" >:: "haha :: (t1 -> t2) -> t1 -> t2"
1115+ [ "abc = True" >:: "abc :: Bool"
1116+ , "foo a b = a + b" >:: "foo :: Num a => a -> a -> a"
1117+ , "bar a b = show $ a + b" >:: "bar :: (Show a, Num a) => a -> a -> String"
1118+ , "(!!!) a b = a > b" >:: "(!!!) :: Ord a => a -> a -> Bool"
1119+ , "a >>>> b = a + b" >:: "(>>>>) :: Num a => a -> a -> a"
1120+ , "a `haha` b = a b" >:: "haha :: (t1 -> t2) -> t1 -> t2"
1121+ , "pattern Some a = Just a" >:: "pattern Some :: a -> Maybe a"
11211122 ]
11221123
11231124addSigLensesTests :: TestTree
11241125addSigLensesTests = let
1125− missing = "{-# OPTIONS_GHC -Wmissing-signatures -Wunused-matches #-}"
1126+ missing = "{-# OPTIONS_GHC -Wmissing-signatures -Wmissing-pattern-synonym-signatures -Wunused-matches #-}"
11261127 notMissing = "{-# OPTIONS_GHC -Wunused-matches #-}"
1127− moduleH = "module Sigs where"
1128+ moduleH = "{-# LANGUAGE PatternSynonyms #-}\nmodule Sigs where"
11281129 other = T.unlines ["f :: Integer -> Integer", "f x = 3"]
11291130 before withMissing def
11301131 = T.unlines $ (if withMissing then (missing :) else (notMissing :)) [moduleH, def, other]
@@ -1141,22 +1142,19 @@ addSigLensesTests = let
11411142 liftIO $ expectedCode @=? modifiedCode
11421143 in
11431144 testGroup "add signature"
1144− [ testGroup "with warnings enabled"
1145− [ sigSession True "abc = True" "abc :: Bool"
1146− , sigSession True "foo a b = a + b" "foo :: Num a => a -> a -> a"
1147− , sigSession True "bar a b = show $ a + b" "bar :: (Show a, Num a) => a -> a -> String"
1148− , sigSession True "(!!!) a b = a > b" "(!!!) :: Ord a => a -> a -> Bool"
1149− , sigSession True "a >>>> b = a + b" "(>>>>) :: Num a => a -> a -> a"
1150− , sigSession True "a `haha` b = a b" "haha :: (t1 -> t2) -> t1 -> t2"
1151− ]
1152− , testGroup "with warnings disabled"
1153− [ sigSession False "abc = True" "abc :: Bool"
1154− , sigSession False "foo a b = a + b" "foo :: Num a => a -> a -> a"
1155− , sigSession False "bar a b = show $ a + b" "bar :: (Show a, Num a) => a -> a -> String"
1156− , sigSession False "(!!!) a b = a > b" "(!!!) :: Ord a => a -> a -> Bool"
1157− , sigSession False "a >>>> b = a + b" "(>>>>) :: Num a => a -> a -> a"
1158− , sigSession False "a `haha` b = a b" "haha :: (t1 -> t2) -> t1 -> t2"
1145+ [ testGroup title
1146+ [ sigSession enableWarnings "abc = True" "abc :: Bool"
1147+ , sigSession enableWarnings "foo a b = a + b" "foo :: Num a => a -> a -> a"
1148+ , sigSession enableWarnings "bar a b = show $ a + b" "bar :: (Show a, Num a) => a -> a -> String"
1149+ , sigSession enableWarnings "(!!!) a b = a > b" "(!!!) :: Ord a => a -> a -> Bool"
1150+ , sigSession enableWarnings "a >>>> b = a + b" "(>>>>) :: Num a => a -> a -> a"
1151+ , sigSession enableWarnings "a `haha` b = a b" "haha :: (t1 -> t2) -> t1 -> t2"
1152+ , sigSession enableWarnings "pattern Some a = Just a" "pattern Some :: a -> Maybe a"
11591153 ]
1154+ | (title, enableWarnings) <-
1155+ [("with warnings enabled", True)
1156+ ,("with warnings disabled", False)
1157+ ]
11601158 ]
11611159
11621160findDefinitionAndHoverTests :: TestTree