hspec-junit-formatter 1.3.1.0 → 1.3.1.1
raw patch · 2 files changed
+11/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
hspec-junit-formatter.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: hspec-junit-formatter-version: 1.3.1.0+version: 1.3.1.1 license: MIT license-file: LICENSE copyright: 2021 Renaissance Learning Inc
library/Test/Hspec/JUnit/Render.hs view
@@ -10,6 +10,8 @@ import Data.Array qualified as Array import Data.Fixed (Nano) import Data.Foldable (traverse_)+import Data.List (stripPrefix)+import Data.Maybe (fromMaybe) import Data.Semigroup (Endo (..)) import Data.Text (Text, pack) import Data.Text qualified as T@@ -56,7 +58,7 @@ <> attr "assertions" (unAttr (pack . show) s.assertions) <> attr "time" (unAttr unSeconds s.time) <> attr "timestamp" (unAttr (pack . formatISO8601) s.timestamp)- <> optionalAttr "file" (unAttr (pack . prefix) <$> s.file)+ <> optionalAttr "file" (unAttr (pack . prefix . dropPrefix "./") <$> s.file) ) $ traverse_ renderTestsuiteChild s.children @@ -113,7 +115,7 @@ <> attr "classname" (unAttr id c.classname) <> attr "assertions" (unAttr (pack . show) c.assertions) <> attr "time" (unAttr unSeconds c.time)- <> optionalAttr "file" (unAttr (pack . prefix) <$> c.file)+ <> optionalAttr "file" (unAttr (pack . prefix . dropPrefix "./") <$> c.file) <> optionalAttr "line" (unAttr (pack . show) <$> c.line) ) $ do@@ -213,3 +215,9 @@ where (begining, rest) = T.splitAt offset input (_, end) = T.splitAt len rest++-- |+--+-- Inlined from <https://hackage-content.haskell.org/package/extra-1.8.1/docs/src/Data.List.Extra.html#dropPrefix>+dropPrefix :: Eq a => [a] -> [a] -> [a]+dropPrefix a b = fromMaybe b $ stripPrefix a b