File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
test/Spec/BotPlutusInterface Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ test-suite bot-plutus-interface-test
219219 , plutus-pab
220220 , plutus-tx
221221 , plutus-tx-plugin
222+ , pretty-diff
222223 , prettyprinter
223224 , QuickCheck
224225 , quickcheck-instances
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ import Plutus.Contract (
4545 )
4646import PlutusTx qualified
4747import PlutusTx.Builtins (fromBuiltin )
48+ import Pretty.Diff (
49+ MultilineContext (FullContext ),
50+ Wrapping (Wrap ),
51+ )
52+ import Pretty.Diff qualified as Diff
4853import Spec.MockContract (
4954 MockContractState (.. ),
5055 addr1 ,
@@ -903,7 +908,14 @@ assertCommandHistory state =
903908assertCommandEqual :: String -> Text -> Text -> Assertion
904909assertCommandEqual err expected actual
905910 | commandEqual expected actual = pure ()
906- | otherwise = assertFailure $ err ++ " \n Expected:\n " ++ show expected ++ " \n Got:\n " ++ show actual
911+ | otherwise = assertFailure $ err ++ " \n " ++ prettyPrintDiff expected actual
912+
913+ prettyPrintDiff :: Text -> Text -> String
914+ prettyPrintDiff expected actual =
915+ " \n Expected:\n "
916+ ++ Text. unpack (Diff. above (Wrap 80 ) FullContext (Text. replace " \n " " " expected) actual)
917+ ++ " \n Got:\n "
918+ ++ Text. unpack (Diff. below (Wrap 80 ) FullContext (Text. replace " \n " " " expected) actual)
907919
908920{- | Checks if a command matches an expected command pattern
909921 Where a command pattern may use new lines in place of spaces, and use the wildcard `?` to match up to the next space
You can’t perform that action at this time.
0 commit comments