Skip to content

Commit

Permalink
Add a few more laws to be tested
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Jan 23, 2024
1 parent 631456e commit 80cfc23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/cardano-data/cardano-data.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ test-suite cardano-data-tests
cardano-ledger-binary:{cardano-ledger-binary, testlib},
testlib,
QuickCheck,
quickcheck-classes-base,
quickcheck-classes,
microlens
6 changes: 4 additions & 2 deletions libs/cardano-data/test/Test/Cardano/Data/OMap/StrictSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck (Arbitrary)
import Test.QuickCheck.Arbitrary (Arbitrary (arbitrary))
import Test.QuickCheck.Classes.Base
import Test.QuickCheck.Classes
import Prelude hiding (elem, filter, lookup, null)

spec :: Spec
Expand Down Expand Up @@ -148,10 +148,12 @@ spec =
it "Type" $
lawsCheckOne
(Proxy :: Proxy (OMap Int Int))
[ isListLaws
[ eqLaws
, isListLaws
, semigroupLaws
, monoidLaws
, semigroupMonoidLaws
, commutativeMonoidLaws
]

instance HasOKey Int Int where
Expand Down
7 changes: 5 additions & 2 deletions libs/cardano-data/test/Test/Cardano/Data/OSet/StrictSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Test.Cardano.Data.Arbitrary ()
import Test.Cardano.Ledger.Binary.RoundTrip (cborTrip, embedTripSpec, roundTripCborSpec)
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck.Classes.Base
import Test.QuickCheck.Classes

spec :: Spec
spec =
Expand Down Expand Up @@ -95,8 +95,11 @@ spec =
it "Type" $
lawsCheckOne
(Proxy :: Proxy (OSet Int))
[ isListLaws
[ eqLaws
, ordLaws
, isListLaws
, semigroupLaws
, monoidLaws
, semigroupMonoidLaws
, commutativeMonoidLaws
]

0 comments on commit 80cfc23

Please sign in to comment.