Skip to content

Commit

Permalink
Add prop_difference_invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Mar 2, 2021
1 parent 23a398a commit 0592436
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -187,6 +187,8 @@ spec =
property prop_difference_leq
it "prop_difference_add ((x - y) + y ⊇ x)" $
property prop_difference_add
it "prop_difference_invariant" $
property prop_difference_invariant

parallel $ describe "Quantities" $ do

Expand Down Expand Up @@ -293,6 +295,10 @@ prop_difference_add x y =
counterexample ("(x - y) + y = " <> show yAndDelta) $
property $ x `leq` yAndDelta

prop_difference_invariant :: TokenMap -> TokenMap -> Property
prop_difference_invariant m1 m2 =
property $ invariantHolds $ TokenMap.difference m1 m2

prop_setQuantity_invariant
:: TokenMap -> AssetId -> TokenQuantity -> Property
prop_setQuantity_invariant b asset quantity = property $
Expand Down

0 comments on commit 0592436

Please sign in to comment.