Skip to content

Commit

Permalink
Fix "Gave up!" problem in property
Browse files Browse the repository at this point in the history
- Simply removing `==>` seems to work fine, and make it more likely to
  pass.
- Remove `withMaxSuccess` because it seems to be doing nothing in
  conjunction with `checkCoverage`.
  • Loading branch information
Anviking committed Mar 31, 2022
1 parent aa85d19 commit 7c59a5b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/shelley/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2351,22 +2351,24 @@ prop_balanceTransactionUnresolvedInputs
-> ShowBuildable PartialTx
-> StdGenSeed
-> Property
prop_balanceTransactionUnresolvedInputs wallet (ShowBuildable partialTx')
seed = checkCoverage $ withMaxSuccess 400 $
forAll (dropResolvedInputs partialTx') $ \(partialTx, dropped) -> do
not (null dropped) ==> do
prop_balanceTransactionUnresolvedInputs wallet (ShowBuildable partialTx') seed =
checkCoverage
$ forAll (dropResolvedInputs partialTx') $ \(partialTx, dropped) -> do
let res = balanceTransaction' wallet seed partialTx
cover 1 (isUnresolvedTxInsErr res) "unknown txins" $
case res of
Right _
-> label "success" $ property True
-- Balancing can succeed if the dropped inputs happen
-- to be apart of the wallet UTxO.
| null dropped
-> label "nothing dropped"
$ property True
| otherwise
-> label "succeeded despite unresolved input"
$ property True
Left (ErrBalanceTxAssignRedeemers
(ErrAssignRedeemersUnresolvedTxIns _))
-> property True
Left _
-> property True
-> label "other error" $ property True
where
isUnresolvedTxInsErr
(Left (ErrBalanceTxAssignRedeemers
Expand Down

0 comments on commit 7c59a5b

Please sign in to comment.