@@ -51,6 +51,7 @@ import Spec.MockContract (
5151 )
5252import Test.Tasty (TestTree , testGroup )
5353import Test.Tasty.HUnit (Assertion , assertBool , assertFailure , testCase , (@?=) )
54+ import Text.Printf (printf )
5455import Prelude
5556
5657{- | Tests for 'cardano-cli query utxo' result parsers
@@ -239,13 +240,13 @@ dontAddChangeToDatum = do
239240 (balScrUtxos, balOtherUtxos) = partition isScrUtxo (txOutputs trx)
240241 assertBool
241242 ( " Expected UTxO not in output Tx."
242- <> " \n Expected UTxO: "
243+ <> " \n Expected UTxO: \n "
243244 <> show scrTxOutExpected
244- <> " \n Balanced Script UTxOs: "
245+ <> " \n Balanced Script UTxOs: \n "
245246 <> show balScrUtxos
246- <> " \n Other Balanced UTxOs: "
247+ <> " \n Other Balanced UTxOs: \n "
247248 <> show balOtherUtxos
248- <> " \n Unbalanced UTxOs: "
249+ <> " \n Unbalanced UTxOs: \n "
249250 <> show (txOutputs (unbalancedTx ^. OffChain. tx))
250251 )
251252 (scrTxOutExpected `elem` txOutputs trx)
@@ -306,13 +307,13 @@ dontAddChangeToDatum2 = do
306307 -- is in the output.
307308 assertBool
308309 ( " Expected UTxO not in output Tx."
309- <> " \n Expected UTxO: "
310+ <> " \n Expected UTxO: \n "
310311 <> show scrTxOutExpected
311- <> " \n Balanced Script UTxOs: "
312+ <> " \n Balanced Script UTxOs: \n "
312313 <> show balScrUtxos
313- <> " \n Other Balanced UTxOs: "
314+ <> " \n Other Balanced UTxOs: \n "
314315 <> show balOtherUtxos
315- <> " \n Unbalanced UTxOs: "
316+ <> " \n Unbalanced UTxOs: \n "
316317 <> show (txOutputs (unbalancedTx ^. OffChain. tx))
317318 )
318319 (scrTxOutExpected `elem` txOutputs trx)
@@ -331,23 +332,15 @@ dontAddChangeToDatum2 = do
331332 -- Check for ADA change
332333 assertBool
333334 ( " Other UTxOs do not contain expected ADA change."
334- <> " \n Expected Amount : "
335- <> show adaChange
336- <> " Lovelace"
337- <> " \n Actual Amount : "
338- <> show (lovelaceInValue remainingValue)
339- <> " Lovelace"
335+ <> printf " \n Expected Amount : %d Lovelace" adaChange
336+ <> printf " \n Actual Amount : %d Lovelace" (lovelaceInValue remainingValue)
340337 )
341338 (adaChange == lovelaceInValue remainingValue)
342339 -- Check for Token change
343340 assertBool
344341 ( " Other UTxOs do not contain expected Token change."
345- <> " \n Expected Amount : "
346- <> show tokChange
347- <> " tokens"
348- <> " \n Actual Amount : "
349- <> show (acValueOf tokenAsset remainingValue)
350- <> " tokens"
342+ <> printf " \n Expected Amount : %d tokens" tokChange
343+ <> printf " \n Actual Amount : %d tokens" (acValueOf tokenAsset remainingValue)
351344 )
352345 (tokChange == acValueOf tokenAsset remainingValue)
353346
0 commit comments