packages feed

sydtest 0.33.4.0 → 0.33.4.1

raw patch · 4 files changed

+36/−5 lines, 4 files

Files

CHANGELOG.md view
@@ -1,5 +1,18 @@ # Changelog +## [0.33.4.1] - 2026-11-18++### Changed++* When the diff of an equality assertion takes too long and is canceled, the+  failure shows only the first thousand characters of each value.+  Printing large values in full could take minutes.++### Fixed++* Compatibility with newer `opt-env-conf`, whose `confWith'` requires a codec+  that can also encode.+ ## [0.33.4.0] - 2026-11-06  ### Added
src/Test/Syd/OptParse.hs view
@@ -782,7 +782,7 @@             ],         setting           [ help "How parallel to run the test suite",-            confWith' "threads" $ Just <$> codec+            confWith' "threads" $ dimapCodec Just (fromMaybe ByCapabilities) codec           ]       ] 
src/Test/Syd/Output/Common.hs view
@@ -12,7 +12,6 @@ import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NE import Data.Maybe-import Data.String (IsString (..)) import Data.Text (Text) import qualified Data.Text as T import Data.Typeable (cast)@@ -148,9 +147,28 @@       concat         [ [[chunk "Expected these values to be equal:"]],           [[chunk "Diff computation took too long and was canceled"]],-          [[fromString actual]],-          [[fromString expected]]+          canceledDiffValueChunks "Actual:" actual,+          canceledDiffValueChunks "Expected:" expected         ]++-- | Render only a prefix of a value whose diff was canceled.+--+-- Diffs are canceled when they take too long, which happens for large values,+-- and printing a large value in full can take longer than the diff did.+canceledDiffValueChunks :: Text -> String -> [[Chunk]]+canceledDiffValueChunks header value =+  let (shown, elided) = splitAt canceledDiffValueDisplayLimit value+   in concat+        [ [[fore blue (chunk header)]],+          stringChunks shown,+          [ [chunk (T.pack (unwords ["...", show (length elided), "more characters elided"]))]+          | not (null elided)+          ]+        ]++-- | How many characters of a value to show when its diff was canceled.+canceledDiffValueDisplayLimit :: Int+canceledDiffValueDisplayLimit = 1_000  -- The diff-colour helpers ('delColour', 'addColour', 'emphasiseIntraLine', -- 'renderDelSide', 'renderAddSide') used to live here.  They were moved to
sydtest.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           sydtest-version:        0.33.4.0+version:        0.33.4.1 synopsis:       A modern testing framework for Haskell with good defaults and advanced testing features. description:    A modern testing framework for Haskell with good defaults and advanced testing features. Sydtest aims to make the common easy and the hard possible. See https://github.com/NorfairKing/sydtest#readme for more information. category:       Testing