File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 11
11
"dependencies" : {
12
12
"purescript-maybe" : " ^4.0.0" ,
13
13
"purescript-math" : " ^2.1.1" ,
14
- "purescript-generics-rep" : " ^6.1.1"
14
+ "purescript-generics-rep" : " ^6.1.1" ,
15
+ "purescript-quickcheck" : " ^6.1.0"
15
16
},
16
17
"devDependencies" : {
17
- "purescript-quickcheck-laws" : " git://github.com/athanclark/purescript-quickcheck-laws.git#a19fbf646918fa201ddbeafe2653b2c1d83e6dd0 " ,
18
+ "purescript-quickcheck-laws" : " v5.0.1 " ,
18
19
"purescript-psci-support" : " ^4.0.0"
19
20
},
20
21
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ import Data.Show (class Show)
38
38
import Data.Function ((<<<))
39
39
import Data.Semigroup ((<>))
40
40
import Data.Generic.Rep (class Generic , Constructor (..), Argument (..))
41
+ import Test.QuickCheck (class Arbitrary , arbitrary )
42
+ import Prelude ((<$>))
41
43
import Math as Math
42
44
43
45
@@ -50,6 +52,8 @@ instance genericUInt :: Generic UInt (Constructor "UInt" (Argument Number)) wher
50
52
from x = Constructor (Argument (toNumber x))
51
53
to (Constructor (Argument x)) = fromNumber x
52
54
55
+ instance arbitraryUInt :: Arbitrary UInt where
56
+ arbitrary = fromInt <$> arbitrary
53
57
54
58
55
59
-- | Cast an `Int` to an `UInt` turning negative `Int`s into `UInt`s
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Prelude
5
5
import Effect (Effect )
6
6
import Data.UInt (UInt , fromNumber )
7
7
import Data.UInt.Gen (genUInt )
8
- import Test.QuickCheck.Arbitrary (class Arbitrary , arbitrary )
8
+ import Test.QuickCheck.Arbitrary (class Arbitrary )
9
9
import Test.QuickCheck.Laws.Data as Data
10
10
import Type.Proxy (Proxy (..))
11
11
@@ -26,10 +26,10 @@ derive newtype instance euclideanRingTestUInt :: EuclideanRing TestUInt
26
26
main :: Effect Unit
27
27
main = do
28
28
let prxUInt = Proxy ∷ Proxy TestUInt
29
- Data .checkEqShow prxUInt
30
- Data .checkOrdShow prxUInt
31
- Data .checkSemiringShow prxUInt
32
- Data .checkRingShow prxUInt
33
- Data .checkEuclideanRingShow prxUInt
34
- Data .checkBoundedShow prxUInt
35
- Data .checkCommutativeRingShow prxUInt
29
+ Data .checkEq prxUInt
30
+ Data .checkOrd prxUInt
31
+ Data .checkSemiring prxUInt
32
+ Data .checkRing prxUInt
33
+ Data .checkEuclideanRing prxUInt
34
+ Data .checkBounded prxUInt
35
+ Data .checkCommutativeRing prxUInt
You can’t perform that action at this time.
0 commit comments