Skip to content

Commit

Permalink
Update tree-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Jun 2, 2023
1 parent cfae930 commit ff9982e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions cabal.project
Expand Up @@ -107,3 +107,8 @@ source-repository-package
--sha256: 18apsg2lqjv9cc29nbd3hzj2hqhksqjj0s4xp2rdv8cbd27racjh
subdir:
cborg

source-repository-package
type: git
location: https://github.com/jasagredo/tree-diff
tag: a97c7ab0792efee192a11d693cef69801c0fb280
4 changes: 2 additions & 2 deletions libs/cardano-ledger-binary/src/Cardano/Ledger/TreeDiff.hs
Expand Up @@ -24,7 +24,7 @@ import Data.Foldable (toList)
import Data.IP (IPv4, IPv6)
import Data.Maybe.Strict (StrictMaybe)
import Data.Sequence.Strict (StrictSeq)
import Data.TreeDiff (ansiWlEditExpr, prettyEditExpr)
import Data.TreeDiff (ansiEditExpr, prettyEditExpr)
import Data.TreeDiff.Class (ToExpr (listToExpr, toExpr), defaultExprViaShow, ediff)
import Data.TreeDiff.Expr (Expr (App, Lst, Rec))
import Data.TreeDiff.QuickCheck (ediffEq)
Expand All @@ -36,7 +36,7 @@ trimExprViaShow :: Show a => Int -> a -> Expr
trimExprViaShow _n x = defaultExprViaShow x -- App (take n (drop 1 (show x)) ++ "..") []

diffExpr :: ToExpr a => a -> a -> String
diffExpr x y = show (ansiWlEditExpr (ediff x y))
diffExpr x y = show (ansiEditExpr (ediff x y))

diffExprNoColor :: ToExpr a => a -> a -> String
diffExprNoColor x y = show (prettyEditExpr (ediff x y))
Expand Down
Expand Up @@ -36,7 +36,7 @@ import Test.Tasty.HUnit (Assertion, assertFailure)
--------------------------------------------------------------------------------

showExpr :: ToExpr a => a -> String
showExpr = show . ansiWlExpr . toExpr
showExpr = show . ansiExpr . toExpr

-- | Wraps regular ByteString, but shows and diffs it as hex
newtype HexBytes = HexBytes {unHexBytes :: BS.ByteString}
Expand Down

0 comments on commit ff9982e

Please sign in to comment.