tasty-autocollect 0.4.0 → 0.4.1
raw patch · 23 files changed
+282/−76 lines, 23 filesdep ~bytestringdep ~ghcdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring, ghc, template-haskell
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- README.md +21/−6
- src/Test/Tasty/AutoCollect/Config.hs +8/−7
- src/Test/Tasty/AutoCollect/Constants.hs +1/−0
- src/Test/Tasty/AutoCollect/ConvertTest.hs +2/−2
- src/Test/Tasty/AutoCollect/GHC.hs +3/−6
- src/Test/Tasty/AutoCollect/GHC/Shim.hs +2/−0
- src/Test/Tasty/AutoCollect/GHC/Shim_9_0.hs +11/−3
- src/Test/Tasty/AutoCollect/GHC/Shim_9_2.hs +11/−3
- src/Test/Tasty/AutoCollect/GHC/Shim_9_4.hs +11/−3
- src/Test/Tasty/AutoCollect/GHC/Shim_9_6.hs +156/−0
- src/Test/Tasty/AutoCollect/GHC/Shim_Common.hs +3/−11
- src/Test/Tasty/AutoCollect/GenerateMain.hs +1/−1
- src/Test/Tasty/AutoCollect/Utils/TreeMap.hs +2/−2
- tasty-autocollect.cabal +7/−4
- test/Examples.hs +2/−1
- test/Test/Tasty/AutoCollect/ConfigTest.hs +24/−19
- test/Test/Tasty/AutoCollect/ConvertTestTest.hs +2/−1
- test/Test/Tasty/AutoCollect/GenerateMainTest.hs +2/−1
- test/Test/Tasty/AutoCollect/ModuleTypeTest.hs +2/−1
- test/Test/Tasty/AutoCollect/Utils/TreeMapTest.hs +3/−2
- test/Test/Tasty/Ext/TodoTest.hs +2/−1
- test/TestUtils/Golden.hs +2/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+# v0.4.1++* Add support for GHC 9.6+ # v0.4.0 * Drop support for GHC 8.10
README.md view
@@ -236,8 +236,10 @@ Due to current limitations, the above comments need to be matched exactly (e.g. not with `--` comments or extra whitespace). -## Comparison with `tasty-discover`+## Comparison with other libraries +### `tasty-discover`+ Advantages: * Supports test functions with multiple arguments (e.g. `tasty-golden`) * Avoids hardcoding testers like `unit_` or `prop_`@@ -250,9 +252,24 @@ * Configuration is more extensible, since configuration is parsed from a comment in the main module instead of as preprocessor arguments Disadvantages:-* Uses both a preprocessor and a plugin (`tasty-discover` only uses a preprocessor)+* Uses both a preprocessor and a GHC plugin+ * `tasty-discover` only uses a preprocessor * Haven't tested performance yet, but I wouldn't be surprised if there's a non-negligible performance cost +### `tasty-th`++Advantages:+* See `tasty-discover`+* Automatically generates the `Main.hs` file that discovers + imports all test modules in the directory+ * `tasty-th` provides `defaultMainGenerator`, but it only discovers tests in the same module, so if you have tests in multiple files, you'd still have to manually import all of them into a `Main.hs` file++Disadvantages:+* Uses a preprocessor and a GHC plugin+ * `tasty-th` uses Template Haskell instead of either+ * Haven't tested performance yet, but I wouldn't be surprised if there's a non-negligible performance cost+* `tasty-th` allows including a subset of functions, but not others+ * `tasty-autocollect` includes all tests in one exported list+ ## Appendix ### Debugging @@ -263,11 +280,9 @@ ### Note for Ormolu/Fourmolu -If you're using Ormolu or Fourmolu, use `-- $AUTOCOLLECT.TEST.export$` instead; otherwise, the comment will be moved out of the export list.--This works around the issue by reusing Haddock's named section syntax, but it shouldn't be an issue because you shouldn't be building Haddocks for test modules. If this becomes a problem for you, please open an issue.+If you're using Ormolu < 0.7 or Fourmolu < 0.13, use `-- $AUTOCOLLECT.TEST.export$` instead; otherwise, [the comment will be moved out of the export list](https://github.com/tweag/ormolu/issues/906). -Upstream ticket: https://github.com/tweag/ormolu/issues/906+This works around the issue by reusing Haddock's named section syntax, but it shouldn't be an issue because you shouldn't be building Haddocks for test modules. If this becomes an issue, upgrade Ormolu or Fourmolu. ### How it works
src/Test/Tasty/AutoCollect/Config.hs view
@@ -133,23 +133,24 @@ case k of "import" ->- pure mempty{cfgImports = Just $ map Text.unpack $ parseCSV v}+ pure emptyConfig{cfgImports = Just $ map Text.unpack $ parseCSV v} "suite_name" ->- pure mempty{cfgSuiteName = Just (Just v)}+ pure emptyConfig{cfgSuiteName = Just (Just v)} "group_type" -> do groupType <- parseGroupType v- pure mempty{cfgGroupType = Just groupType}+ pure emptyConfig{cfgGroupType = Just groupType} "strip_suffix" ->- pure mempty{cfgStripSuffix = Just v}+ pure emptyConfig{cfgStripSuffix = Just v} "ingredients" ->- pure mempty{cfgIngredients = Just $ parseCSV v}+ pure emptyConfig{cfgIngredients = Just $ parseCSV v} "ingredients_override" -> do override <- parseBool v- pure mempty{cfgIngredientsOverride = Just override}+ pure emptyConfig{cfgIngredientsOverride = Just override} "custom_main" -> do customMain <- parseBool v- pure mempty{cfgCustomMain = Just customMain}+ pure emptyConfig{cfgCustomMain = Just customMain} _ -> Left $ "Invalid configuration key: " <> Text.pack (show k)+ emptyConfig = mempty :: AutoCollectConfigPartial parseGroupType :: Text -> Either Text AutoCollectGroupType parseGroupType = \case
src/Test/Tasty/AutoCollect/Constants.hs view
@@ -29,6 +29,7 @@ isTestExportComment = matches "autocollect.test.export" . unwrap where -- Support '{- $autocollect.test.export$ -}' for Ormolu/Fourmolu support+ -- Remove when dropping support for Fourmolu < 0.13, Ormolu < 0.7 unwrap = Text.unpack . withoutPrefix "$" . withoutSuffix "$" . Text.pack matches :: String -> String -> Bool
src/Test/Tasty/AutoCollect/ConvertTest.hs view
@@ -84,7 +84,7 @@ if isTestExportComment comment then Just loc else Nothing- exportIE = IEVar NoExtField $ genLoc $ IEName testListName+ exportIE = IEVar NoExtField $ genLoc $ mkIEName testListName -- Generate the `tests` list mkTestsList :: [LocatedN RdrName] -> [LHsDecl GhcPs]@@ -403,5 +403,5 @@ {----- Utilities -----} -concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]+concatMapM :: (Monad m) => (a -> m [b]) -> [a] -> m [b] concatMapM f = fmap concat . mapM f
src/Test/Tasty/AutoCollect/GHC.hs view
@@ -42,7 +42,7 @@ {----- Output helpers -----} -showPpr :: Outputable a => a -> String+showPpr :: (Outputable a) => a -> String showPpr = showSDocUnsafe . ppr {----- Parsers ----}@@ -77,10 +77,7 @@ mkHsVar = lhsvar . genLoc . getRdrName mkHsAppTypes :: LHsExpr GhcPs -> [LHsType GhcPs] -> LHsExpr GhcPs-mkHsAppTypes = foldl' mkHsAppType--mkHsAppType :: LHsExpr GhcPs -> LHsType GhcPs -> LHsExpr GhcPs-mkHsAppType e t = genLoc $ HsAppType xAppTypeE e (HsWC noExtField t)+mkHsAppTypes = foldl' (\e -> genLoc . mkHsAppType e) mkHsTyVar :: Name -> LHsType GhcPs mkHsTyVar = genLoc . HsTyVar noAnn NotPromoted . genLoc . getRdrName@@ -99,7 +96,7 @@ genLoc :: e -> GenLocated (SrcAnn ann) e genLoc = L generatedSrcAnn -firstLocatedWhere :: Ord l => (GenLocated l e -> Maybe a) -> [GenLocated l e] -> Maybe a+firstLocatedWhere :: (Ord l) => (GenLocated l e -> Maybe a) -> [GenLocated l e] -> Maybe a firstLocatedWhere f = listToMaybe . mapMaybe f . sortOn getLoc getSpanLine :: SrcSpan -> String
src/Test/Tasty/AutoCollect/GHC/Shim.hs view
@@ -10,4 +10,6 @@ import Test.Tasty.AutoCollect.GHC.Shim_9_2 as X #elif __GLASGOW_HASKELL__ == 904 import Test.Tasty.AutoCollect.GHC.Shim_9_4 as X+#elif __GLASGOW_HASKELL__ == 906+import Test.Tasty.AutoCollect.GHC.Shim_9_6 as X #endif
src/Test/Tasty/AutoCollect/GHC/Shim_9_0.hs view
@@ -28,8 +28,11 @@ mkExplicitList, mkExplicitTuple, mkLet,- xAppTypeE,+ mkHsAppType, + -- ** Name+ mkIEName,+ -- * Backports SrcAnn, SrcSpanAnn',@@ -138,8 +141,13 @@ mkLet :: HsLocalBinds GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs mkLet binds expr = HsLet noExtField (L generatedSrcAnn binds) expr -xAppTypeE :: XAppTypeE GhcPs-xAppTypeE = noExtField+mkHsAppType :: LHsExpr GhcPs -> LHsType GhcPs -> HsExpr GhcPs+mkHsAppType e t = HsAppType noExtField e (HsWC noExtField t)++{----- Compat / Name -----}++mkIEName :: LocatedN RdrName -> IEWrappedName RdrName+mkIEName = IEName {----- Backports -----}
src/Test/Tasty/AutoCollect/GHC/Shim_9_2.hs view
@@ -29,8 +29,11 @@ mkExplicitList, mkExplicitTuple, mkLet,- xAppTypeE,+ mkHsAppType, + -- ** Name+ mkIEName,+ -- * Backports thNameToGhcNameIO, ) where@@ -136,8 +139,13 @@ mkLet :: HsLocalBinds GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs mkLet binds expr = HsLet noAnn binds expr -xAppTypeE :: XAppTypeE GhcPs-xAppTypeE = generatedSrcSpan+mkHsAppType :: LHsExpr GhcPs -> LHsType GhcPs -> HsExpr GhcPs+mkHsAppType e t = HsAppType generatedSrcSpan e (HsWC noExtField t)++{----- Compat / Name -----}++mkIEName :: LocatedN RdrName -> IEWrappedName RdrName+mkIEName = IEName {----- Backports -----}
src/Test/Tasty/AutoCollect/GHC/Shim_9_4.hs view
@@ -29,8 +29,11 @@ mkExplicitList, mkExplicitTuple, mkLet,- xAppTypeE,+ mkHsAppType, + -- ** Name+ mkIEName,+ -- * Backports thNameToGhcNameIO, ) where@@ -136,8 +139,13 @@ mkLet :: HsLocalBinds GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs mkLet binds expr = HsLet noAnn (L NoTokenLoc HsTok) binds (L NoTokenLoc HsTok) expr -xAppTypeE :: XAppTypeE GhcPs-xAppTypeE = generatedSrcSpan+mkHsAppType :: LHsExpr GhcPs -> LHsType GhcPs -> HsExpr GhcPs+mkHsAppType e t = HsAppType generatedSrcSpan e (HsWC noExtField t)++{----- Compat / Name -----}++mkIEName :: LocatedN RdrName -> IEWrappedName RdrName+mkIEName = IEName {----- Backports -----}
+ src/Test/Tasty/AutoCollect/GHC/Shim_9_6.hs view
@@ -0,0 +1,156 @@+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}++module Test.Tasty.AutoCollect.GHC.Shim_9_6 (+ -- * Re-exports+ module X,++ -- * Compat++ -- ** Plugin+ setKeepRawTokenStream,+ withParsedResultModule,++ -- ** Annotations+ generatedSrcAnn,+ getExportComments,+ toSrcAnnA,++ -- ** Decl+ parseDecl,++ -- ** Type+ parseSigWcType,+ parseType,++ -- ** Expr+ mkExplicitList,+ mkExplicitTuple,+ mkLet,+ mkHsAppType,++ -- ** Name+ mkIEName,++ -- * Backports+ thNameToGhcNameIO,+) where++-- Re-exports+import GHC.Driver.Main as X (getHscEnv)+import GHC.Hs as X hiding (comment, mkHsAppType, mkHsAppTypes)+import GHC.Plugins as X hiding (+ AnnBind (..),+ AnnExpr' (..),+ getHscEnv,+ mkLet,+ msg,+ showPpr,+ thNameToGhcNameIO,+ varName,+ )+import GHC.Types.Name.Cache as X (NameCache)++import qualified Data.Text as Text+import qualified GHC.Data.Strict as Strict+import qualified GHC.Plugins as GHC (thNameToGhcNameIO)+import qualified Language.Haskell.TH as TH++import Test.Tasty.AutoCollect.GHC.Shim_Common+import Test.Tasty.AutoCollect.Utils.Text++{----- Compat / Plugin -----}++setKeepRawTokenStream :: Plugin -> Plugin+setKeepRawTokenStream plugin =+ plugin+ { driverPlugin = \_ env ->+ pure+ env+ { hsc_dflags = hsc_dflags env `gopt_set` Opt_KeepRawTokenStream+ }+ }++withParsedResultModule :: ParsedResult -> (HsParsedModule -> HsParsedModule) -> ParsedResult+withParsedResultModule result f = result{parsedResultModule = f $ parsedResultModule result}++{----- Compat / Annotations -----}++-- | Get the contents of all comments in the given hsmodExports list.+getExportComments :: HsParsedModule -> LocatedL [LIE GhcPs] -> [RealLocated String]+getExportComments _ = map fromLEpaComment . priorComments . epAnnComments . ann . getLoc+ where+ fromLEpaComment (L Anchor{anchor} EpaComment{ac_tok}) =+ L anchor $ (Text.unpack . Text.strip . unwrap) ac_tok+ unwrap = \case+ EpaDocComment doc -> Text.pack $ renderHsDocString doc+ EpaDocOptions s -> Text.pack s+ EpaLineComment s -> withoutPrefix "--" $ Text.pack s+ EpaBlockComment s -> withoutPrefix "{-" . withoutSuffix "-}" $ Text.pack s+ EpaEofComment -> ""++generatedSrcAnn :: SrcAnn ann+generatedSrcAnn = SrcSpanAnn noAnn generatedSrcSpan++toSrcAnnA :: RealSrcSpan -> SrcSpanAnnA+toSrcAnnA rss = SrcSpanAnn noAnn (RealSrcSpan rss Strict.Nothing)++{----- Compat / Decl -----}++parseDecl :: LHsDecl GhcPs -> Maybe ParsedDecl+parseDecl (L _ decl) =+ case decl of+ SigD _ (TypeSig _ names ty) -> Just $ FuncSig names ty+ ValD _ (FunBind _ name MG{mg_alts = L _ matches}) ->+ Just $ FuncDef name $ map (fmap parseFuncSingleDef) matches+ _ -> Nothing+ where+ parseFuncSingleDef Match{m_pats, m_grhss = GRHSs _ bodys whereClause} =+ FuncSingleDef+ { funcDefArgs = m_pats+ , funcDefGuards = map parseFuncGuardedBody bodys+ , funcDefWhereClause = whereClause+ }+ parseFuncGuardedBody (L _ (GRHS _ guards body)) =+ FuncGuardedBody guards body++{----- Compat / Type -----}++parseSigWcType :: LHsSigWcType GhcPs -> Maybe ParsedType+parseSigWcType (HsWC _ (L _ (HsSig _ _ ltype))) = parseType ltype++parseType :: LHsType GhcPs -> Maybe ParsedType+parseType (L _ ty) =+ case ty of+ HsTyVar _ flag name -> Just $ TypeVar flag name+ HsListTy _ t -> TypeList <$> parseType t+ _ -> Nothing++{----- Compat / Expr -----}++mkExplicitList :: [LHsExpr GhcPs] -> HsExpr GhcPs+mkExplicitList = ExplicitList noAnn++mkExplicitTuple :: [HsTupArg GhcPs] -> Boxity -> HsExpr GhcPs+mkExplicitTuple = ExplicitTuple noAnn++mkLet :: HsLocalBinds GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs+mkLet binds expr = HsLet noAnn tokenLoc binds tokenLoc expr++mkHsAppType :: LHsExpr GhcPs -> LHsType GhcPs -> HsExpr GhcPs+mkHsAppType e t = HsAppType noExtField e tokenLoc (HsWC noExtField t)++tokenLoc :: LHsToken tok GhcPs+tokenLoc = L NoTokenLoc HsTok++{----- Compat / Name -----}++mkIEName :: LocatedN RdrName -> IEWrappedName GhcPs+mkIEName = IEName noExtField++{----- Backports -----}++thNameToGhcNameIO :: HscEnv -> NameCache -> TH.Name -> IO (Maybe Name)+thNameToGhcNameIO _ = GHC.thNameToGhcNameIO
src/Test/Tasty/AutoCollect/GHC/Shim_Common.hs view
@@ -8,20 +8,12 @@ ) where import GHC.Hs-#if __GLASGOW_HASKELL__ == 810-import BasicTypes (PromotionFlag)-import RdrName (RdrName)-import SrcLoc (Located)-#elif __GLASGOW_HASKELL__ == 900+#if __GLASGOW_HASKELL__ < 906 import GHC.Types.Basic (PromotionFlag)+#endif import GHC.Types.Name.Reader (RdrName)+#if __GLASGOW_HASKELL__ < 902 import GHC.Types.SrcLoc (Located)-#elif __GLASGOW_HASKELL__ == 902-import GHC.Types.Basic (PromotionFlag)-import GHC.Types.Name.Reader (RdrName)-#elif __GLASGOW_HASKELL__ == 904-import GHC.Types.Basic (PromotionFlag)-import GHC.Types.Name.Reader (RdrName) #endif #if __GLASGOW_HASKELL__ < 902
src/Test/Tasty/AutoCollect/GenerateMain.hs view
@@ -113,7 +113,7 @@ guard $ Text.all (\c -> isUpper c || isLower c || isDigit c || c == '\'') rest Just name - mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]+ mapMaybeM :: (Monad m) => (a -> m (Maybe b)) -> [a] -> m [b] mapMaybeM f = fmap catMaybes . mapM f generateTests :: AutoCollectConfig -> [TestModule] -> Text
src/Test/Tasty/AutoCollect/Utils/TreeMap.hs view
@@ -57,13 +57,13 @@ -- ] -- } -- @-fromList :: Ord k => [([k], v)] -> TreeMap k v+fromList :: (Ord k) => [([k], v)] -> TreeMap k v fromList = foldr (uncurry insert) empty empty :: TreeMap k v empty = TreeMap Nothing Map.empty -insert :: Ord k => [k] -> v -> TreeMap k v -> TreeMap k v+insert :: (Ord k) => [k] -> v -> TreeMap k v -> TreeMap k v insert originalKeys v = go originalKeys where go ks treeMap =
tasty-autocollect.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.0.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: tasty-autocollect-version: 0.4.0+version: 0.4.1 synopsis: Autocollection of tasty tests. description: Autocollection of tasty tests. See README.md for more details. category: Testing@@ -68,13 +68,16 @@ , containers >=0.6.2.1 && <0.7 , directory >=1.3.6.0 && <2 , filepath >=1.4.2.1 && <2- , ghc >=9.0 && <9.5+ , ghc >=9.0 && <9.7 , tasty >=1.4.2.1 && <2 , tasty-expected-failure >=0.11 && <1- , template-haskell >=2.16 && <2.20+ , template-haskell >=2.16 && <2.21 , text >=1.2.3.2 && <3 , transformers >=0.5.6.2 && <1 default-language: Haskell2010+ if impl(ghc >= 9.6) && impl(ghc < 9.8)+ other-modules:+ Test.Tasty.AutoCollect.GHC.Shim_9_6 if impl(ghc >= 9.4) && impl(ghc < 9.6) other-modules: Test.Tasty.AutoCollect.GHC.Shim_9_4
test/Examples.hs view
@@ -2,7 +2,8 @@ {-# LANGUAGE OverloadedStrings #-} module Examples (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import Test.Tasty.Golden
test/Test/Tasty/AutoCollect/ConfigTest.hs view
@@ -6,7 +6,8 @@ {-# LANGUAGE ViewPatterns #-} module Test.Tasty.AutoCollect.ConfigTest (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import Control.Monad (forM_)@@ -144,30 +145,34 @@ test = testCase "resolveConfig imports config recursively" $ withSystemTempDirectory "tasty-autocollect-resolveConfig" $ \tmpdir -> do- let- files =- [- ( "foo/autocollect.conf"- ,- [ "import = ../base/autocollect.conf"- , "suite_name = foo"- ]- )- ,- ( "base/autocollect.conf"- ,- [ "suite_name = base"- , "ingredients = baseIngredients"- ]- )- ] forM_ files $ \(fpRel, fileLines) -> do let fp = tmpdir </> fpRel createDirectoryIfMissing True (takeDirectory fp) Text.writeFile fp (Text.unlines fileLines)- cfg <- resolveConfig (tmpdir </> "Main.hs") mempty{cfgImports = Just ["foo/autocollect.conf"]}+ cfg <- resolveConfig (tmpdir </> "Main.hs") config cfgSuiteName cfg @?= Just "foo" cfgIngredients cfg @?= ["baseIngredients"]+ where+ files =+ [+ ( "foo/autocollect.conf"+ ,+ [ "import = ../base/autocollect.conf"+ , "suite_name = foo"+ ]+ )+ ,+ ( "base/autocollect.conf"+ ,+ [ "suite_name = base"+ , "ingredients = baseIngredients"+ ]+ )+ ]+ config =+ (mempty :: AutoCollectConfigPartial)+ { cfgImports = Just ["foo/autocollect.conf"]+ } {----- Helpers -----}
test/Test/Tasty/AutoCollect/ConvertTestTest.hs view
@@ -3,7 +3,8 @@ {-# LANGUAGE OverloadedStrings #-} module Test.Tasty.AutoCollect.ConvertTestTest (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import Control.Monad (forM_)
test/Test/Tasty/AutoCollect/GenerateMainTest.hs view
@@ -2,7 +2,8 @@ {-# LANGUAGE OverloadedStrings #-} module Test.Tasty.AutoCollect.GenerateMainTest (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import qualified Data.ByteString as ByteString
test/Test/Tasty/AutoCollect/ModuleTypeTest.hs view
@@ -3,7 +3,8 @@ {-# LANGUAGE TemplateHaskell #-} module Test.Tasty.AutoCollect.ModuleTypeTest (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import qualified Data.Text as Text
test/Test/Tasty/AutoCollect/Utils/TreeMapTest.hs view
@@ -1,7 +1,8 @@ {- AUTOCOLLECT.TEST -} module Test.Tasty.AutoCollect.Utils.TreeMapTest (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import qualified Data.Map.Strict as Map@@ -28,5 +29,5 @@ ] } -child :: Ord k => k -> Maybe v -> [(k, TreeMap k v)] -> (k, TreeMap k v)+child :: (Ord k) => k -> Maybe v -> [(k, TreeMap k v)] -> (k, TreeMap k v) child k v sub = (k, TreeMap v (Map.fromList sub))
test/Test/Tasty/Ext/TodoTest.hs view
@@ -2,7 +2,8 @@ {-# LANGUAGE OverloadedStrings #-} module Test.Tasty.Ext.TodoTest (- -- $AUTOCOLLECT.TEST.export$+-- AUTOCOLLECT.TEST.export+ ) where import Test.Predicates
test/TestUtils/Golden.hs view
@@ -12,7 +12,7 @@ import Test.Tasty (TestTree) import Test.Tasty.Golden -#if __GLASGOW_HASKELL__ != 904+#if __GLASGOW_HASKELL__ < 904 import qualified Data.Text as Text #endif @@ -21,7 +21,7 @@ -- GHC 9.4 added a prefix to pgmError messages. Normalize old versions to show new format. normalizePgmError :: Text -> Text-#if __GLASGOW_HASKELL__ == 904+#if __GLASGOW_HASKELL__ >= 904 normalizePgmError = id #else normalizePgmError t