@@ -51,6 +51,7 @@ import Spec.MockContract (
51
51
)
52
52
import Test.Tasty (TestTree , testGroup )
53
53
import Test.Tasty.HUnit (Assertion , assertBool , assertFailure , testCase , (@?=) )
54
+ import Text.Printf (printf )
54
55
import Prelude
55
56
56
57
{- | Tests for 'cardano-cli query utxo' result parsers
@@ -239,13 +240,13 @@ dontAddChangeToDatum = do
239
240
(balScrUtxos, balOtherUtxos) = partition isScrUtxo (txOutputs trx)
240
241
assertBool
241
242
( " Expected UTxO not in output Tx."
242
- <> " \n Expected UTxO: "
243
+ <> " \n Expected UTxO: \n "
243
244
<> show scrTxOutExpected
244
- <> " \n Balanced Script UTxOs: "
245
+ <> " \n Balanced Script UTxOs: \n "
245
246
<> show balScrUtxos
246
- <> " \n Other Balanced UTxOs: "
247
+ <> " \n Other Balanced UTxOs: \n "
247
248
<> show balOtherUtxos
248
- <> " \n Unbalanced UTxOs: "
249
+ <> " \n Unbalanced UTxOs: \n "
249
250
<> show (txOutputs (unbalancedTx ^. OffChain. tx))
250
251
)
251
252
(scrTxOutExpected `elem` txOutputs trx)
@@ -306,13 +307,13 @@ dontAddChangeToDatum2 = do
306
307
-- is in the output.
307
308
assertBool
308
309
( " Expected UTxO not in output Tx."
309
- <> " \n Expected UTxO: "
310
+ <> " \n Expected UTxO: \n "
310
311
<> show scrTxOutExpected
311
- <> " \n Balanced Script UTxOs: "
312
+ <> " \n Balanced Script UTxOs: \n "
312
313
<> show balScrUtxos
313
- <> " \n Other Balanced UTxOs: "
314
+ <> " \n Other Balanced UTxOs: \n "
314
315
<> show balOtherUtxos
315
- <> " \n Unbalanced UTxOs: "
316
+ <> " \n Unbalanced UTxOs: \n "
316
317
<> show (txOutputs (unbalancedTx ^. OffChain. tx))
317
318
)
318
319
(scrTxOutExpected `elem` txOutputs trx)
@@ -331,23 +332,15 @@ dontAddChangeToDatum2 = do
331
332
-- Check for ADA change
332
333
assertBool
333
334
( " 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)
340
337
)
341
338
(adaChange == lovelaceInValue remainingValue)
342
339
-- Check for Token change
343
340
assertBool
344
341
( " 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)
351
344
)
352
345
(tokChange == acValueOf tokenAsset remainingValue)
353
346
0 commit comments