Add after review fixes.
This commit is contained in:
parent
2973d60456
commit
ec824b19f9
1 changed files with 9 additions and 8 deletions
|
|
@ -84,8 +84,8 @@ import Test.QuickCheck (
|
||||||
forAll,
|
forAll,
|
||||||
listOf1,
|
listOf1,
|
||||||
)
|
)
|
||||||
import Test.Tasty (TestTree, testGroup)
|
import Test.Tasty (TestTree, adjustOption, testGroup)
|
||||||
import Test.Tasty.QuickCheck (testProperty)
|
import Test.Tasty.QuickCheck (QuickCheckTests, testProperty)
|
||||||
|
|
||||||
data GovernorDatumCases
|
data GovernorDatumCases
|
||||||
= ExecuteLE0
|
= ExecuteLE0
|
||||||
|
|
@ -205,8 +205,8 @@ governorMintingPolicyTests =
|
||||||
and checking if it runs as expected by a test.
|
and checking if it runs as expected by a test.
|
||||||
-}
|
-}
|
||||||
governorPolicyValid :: ScriptContext -> Bool -> Property
|
governorPolicyValid :: ScriptContext -> Bool -> Property
|
||||||
governorPolicyValid ctx shouldSuceed =
|
governorPolicyValid ctx shouldSucceed =
|
||||||
let mp = mkPolicyScript ctx in if shouldSuceed then shouldRun mp else shouldCrash mp
|
let mp = mkPolicyScript ctx in if shouldSucceed then shouldRun mp else shouldCrash mp
|
||||||
|
|
||||||
{-# INLINEABLE mkPolicyScript #-}
|
{-# INLINEABLE mkPolicyScript #-}
|
||||||
mkPolicyScript :: ScriptContext -> Script
|
mkPolicyScript :: ScriptContext -> Script
|
||||||
|
|
@ -220,9 +220,7 @@ mkPolicyScript ctx = mustCompile (go # pconstant ctx)
|
||||||
# pforgetData (pconstantData ())
|
# pforgetData (pconstantData ())
|
||||||
# sc
|
# sc
|
||||||
|
|
||||||
{- | Prepares a minting policy test for given policy error case.
|
-- | Prepares a minting policy test for given policy error case.
|
||||||
NOTE
|
|
||||||
-}
|
|
||||||
mkGovMintingCasePropertyTest ::
|
mkGovMintingCasePropertyTest ::
|
||||||
String ->
|
String ->
|
||||||
GovernorPolicyCases ->
|
GovernorPolicyCases ->
|
||||||
|
|
@ -288,9 +286,12 @@ mkGovMintingCasePropertyTest name case' positiveCaseName negativeCaseName =
|
||||||
|
|
||||||
props :: [TestTree]
|
props :: [TestTree]
|
||||||
props =
|
props =
|
||||||
[ testProperty "governorDatumValid" governorDatumValidProperty
|
[ adjustOption go . testProperty "governorDatumValid" $ governorDatumValidProperty
|
||||||
, testGroup "governorPolicy" governorMintingPolicyTests
|
, testGroup "governorPolicy" governorMintingPolicyTests
|
||||||
]
|
]
|
||||||
|
where
|
||||||
|
go :: QuickCheckTests -> QuickCheckTests
|
||||||
|
go = min 2000
|
||||||
|
|
||||||
loudEval ::
|
loudEval ::
|
||||||
forall (p :: S -> Type).
|
forall (p :: S -> Type).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue