packages feed

tasty 1.5.2 → 1.5.3

raw patch · 3 files changed

+36/−11 lines, 3 filesdep ~containersdep ~optparse-applicativePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: containers, optparse-applicative

API changes (from Hackage documentation)

- Test.Tasty.Options: [Option] :: IsOption v => Proxy v -> OptionDescription
+ Test.Tasty.Options: [Option] :: forall v. IsOption v => Proxy v -> OptionDescription
- Test.Tasty.Options: changeOption :: forall v. IsOption v => (v -> v) -> OptionSet -> OptionSet
+ Test.Tasty.Options: changeOption :: IsOption v => (v -> v) -> OptionSet -> OptionSet
- Test.Tasty.Options: flagCLParser :: forall v. IsOption v => Maybe Char -> v -> Parser v
+ Test.Tasty.Options: flagCLParser :: IsOption v => Maybe Char -> v -> Parser v
- Test.Tasty.Options: lookupOption :: forall v. IsOption v => OptionSet -> v
+ Test.Tasty.Options: lookupOption :: IsOption v => OptionSet -> v
- Test.Tasty.Options: mkFlagCLParser :: forall v. IsOption v => Mod FlagFields v -> v -> Parser v
+ Test.Tasty.Options: mkFlagCLParser :: IsOption v => Mod FlagFields v -> v -> Parser v
- Test.Tasty.Options: mkOptionCLParser :: forall v. IsOption v => Mod OptionFields v -> Parser v
+ Test.Tasty.Options: mkOptionCLParser :: IsOption v => Mod OptionFields v -> Parser v
- Test.Tasty.Providers.ConsoleFormat: type ConsoleFormatPrinter = -- | selected console format ConsoleFormat -> -- | action to be executed with active console format IO () -> IO ()
+ Test.Tasty.Providers.ConsoleFormat: type ConsoleFormatPrinter = ConsoleFormat -> IO () -> IO ()
- Test.Tasty.Runners: Ap :: f a -> Ap f a
+ Test.Tasty.Runners: Ap :: f a -> Ap (f :: Type -> Type) a
- Test.Tasty.Runners: Traversal :: f () -> Traversal f
+ Test.Tasty.Runners: Traversal :: f () -> Traversal (f :: Type -> Type)
- Test.Tasty.Runners: TreeFold :: (forall t. IsTest t => OptionSet -> TestName -> t -> b) -> (OptionSet -> TestName -> [b] -> b) -> (forall a. OptionSet -> ResourceSpec a -> (IO a -> b) -> b) -> (OptionSet -> DependencyType -> Expr -> b -> b) -> TreeFold b
+ Test.Tasty.Runners: TreeFold :: (forall t. IsTest t => OptionSet -> TestName -> t -> b) -> (OptionSet -> TestName -> [b] -> b) -> (forall a. () => OptionSet -> ResourceSpec a -> (IO a -> b) -> b) -> (OptionSet -> DependencyType -> Expr -> b -> b) -> TreeFold b
- Test.Tasty.Runners: [foldResource] :: TreeFold b -> forall a. OptionSet -> ResourceSpec a -> (IO a -> b) -> b
+ Test.Tasty.Runners: [foldResource] :: TreeFold b -> forall a. () => OptionSet -> ResourceSpec a -> (IO a -> b) -> b
- Test.Tasty.Runners: [getApp] :: Ap f a -> f a
+ Test.Tasty.Runners: [getApp] :: Ap (f :: Type -> Type) a -> f a
- Test.Tasty.Runners: [getTraversal] :: Traversal f -> f ()
+ Test.Tasty.Runners: [getTraversal] :: Traversal (f :: Type -> Type) -> f ()
- Test.Tasty.Runners: foldTestTree :: forall b. Monoid b => TreeFold b -> OptionSet -> TestTree -> b
+ Test.Tasty.Runners: foldTestTree :: Monoid b => TreeFold b -> OptionSet -> TestTree -> b
- Test.Tasty.Runners: newtype Ap f a
+ Test.Tasty.Runners: newtype Ap (f :: Type -> Type) a
- Test.Tasty.Runners: newtype Traversal f
+ Test.Tasty.Runners: newtype Traversal (f :: Type -> Type)
- Test.Tasty.Runners: type StatusMap = IntMap (TVar Status)
+ Test.Tasty.Runners: type StatusMap = IntMap TVar Status

Files

CHANGELOG.md view
@@ -1,6 +1,16 @@ Changes ======= +Version 1.5.3+--------------++_2025-01-05_++* Console reporter: disable line wrapping+  ([#433](https://github.com/UnkindPartition/tasty/pull/433)).+* Console reporter: force flushing of stdout after `showCursor`+  ([#436](https://github.com/UnkindPartition/tasty/pull/436)).+ Version 1.5.2 -------------- 
Test/Tasty/Ingredients/ConsoleReporter.hs view
@@ -135,7 +135,6 @@     !alignment = computeAlignment opts tree      MinDurationToReport{minDurationMicros} = lookupOption opts-    AnsiTricks{getAnsiTricks} = lookupOption opts      runSingleTest       :: (IsTest t, ?colors :: Bool)@@ -153,7 +152,7 @@           (replicate postNamePadding ' ')          printTestName = do-          putStr testNamePadded+          withoutLineWrap $ putStr testNamePadded           hFlush stdout          printTestProgress progress@@ -173,8 +172,9 @@               -- A new progress message may be shorter than the previous one               -- so we must clean whole line and print anew.               clearLine-              putStr testNamePadded-              infoOk msg+              withoutLineWrap $ do+                putStr testNamePadded+                infoOk msg               hFlush stdout          printTestResult result = do@@ -189,10 +189,11 @@                 _ -> fail             time = resultTime result -          when getAnsiTricks $ do-            putChar '\r'-            clearLine-            putStr testNamePadded+          withoutLineWrap $ do+            when getAnsiTricks $ do+              putChar '\r'+              clearLine+              putStr testNamePadded            printFn (resultShortDescription result)           when (floor (time * 1e6) >= minDurationMicros) $@@ -211,7 +212,7 @@     runGroup _opts name grp = Ap $ do       level <- ask       let-        printHeading = printf "%s%s\n" (indent level) name+        printHeading = withoutLineWrap $ printf "%s%s\n" (indent level) name         printBody = runReader (getApp (mconcat grp)) (level + 1)       return $ PrintHeading name printHeading printBody @@ -223,7 +224,19 @@           , foldGroup = runGroup           }           opts tree+  where+    AnsiTricks{getAnsiTricks} = lookupOption opts+    -- We must ensure these lines don't wrap, otherwise the wrong+    -- line will be cleared later or the test tree printing will+    -- itself wrap.+    withoutLineWrap :: IO () -> IO ()+#if MIN_VERSION_ansi_terminal(1,1,2)+    withoutLineWrap m | getAnsiTricks =+      bracket_ disableLineWrap enableLineWrap m+#endif+    withoutLineWrap m = m + -- | Make sure the progress text does not contain any newlines or line feeds, -- lest our ANSI magic breaks. Since the progress text is expected to be short, -- we simply drop anything after a newline.@@ -550,7 +563,9 @@       isTermColor <- hSupportsANSIColor stdout        (\k -> if isTerm-        then (do hideCursor; k) `finally` showCursor+        -- When killing with Ctrl+C 'showCursor' can fail+        -- to restore terminal cursor if not flushed explicitly+        then (do hideCursor; k) `finally` (do showCursor; hFlush stdout)         else k) $ do            hSetBuffering stdout LineBuffering
tasty.cabal view
@@ -1,6 +1,6 @@ cabal-version:       >=1.10 name:                tasty-version:             1.5.2+version:             1.5.3 synopsis:            Modern and extensible testing framework description:         Tasty is a modern testing framework for Haskell.                      It lets you combine your unit tests, golden