on master help sign in
Bump hedgehog
ce51927Huw Campbell
grenade.cabal+1−1
@@ -149,7 +149,7 @@ test-suite test
149 build-depends:
149 build-depends:
150 base >= 4.8 && < 5
150 base >= 4.8 && < 5
151 , grenade
151 , grenade
152− , hedgehog >= 0.1 && < 0.2
152+ , hedgehog >= 0.4 && < 0.5
153 , hmatrix
153 , hmatrix
154 , mtl
154 , mtl
155 , singletons
155 , singletons
test/Test/Grenade/Layers/Convolution.hs+1−1
@@ -101,4 +101,4 @@ prop_conv_net = property $
101
101
102
102
103tests :: IO Bool
103tests :: IO Bool
104−tests = $$(checkConcurrent)
104+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/FullyConnected.hs+1−1
@@ -50,4 +50,4 @@ prop_fully_connected_forwards = property $ do
50 backed `seq` success
50 backed `seq` success
51
51
52tests :: IO Bool
52tests :: IO Bool
53−tests = $$(checkConcurrent)
53+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Internal/Convolution.hs+1−2
@@ -53,6 +53,5 @@ prop_im2col_col2im_behaves_as_reference =
53 outFast === outReference
53 outFast === outReference
54 retFast === retReference
54 retFast === retReference
55
55
56−return []
57tests :: IO Bool
56tests :: IO Bool
58−tests = $$(checkConcurrent)
57+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Internal/Pooling.hs+1−1
@@ -42,4 +42,4 @@ prop_poolForwards_poolBackwards_behaves_as_reference =
42
42
43
43
44tests :: IO Bool
44tests :: IO Bool
45−tests = $$(checkConcurrent)
45+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Nonlinear.hs+3−4
@@ -22,7 +22,7 @@ import Numeric.LinearAlgebra.Static ( norm_Inf )
22
22
23prop_sigmoid_grad :: Property
23prop_sigmoid_grad :: Property
24prop_sigmoid_grad = property $
24prop_sigmoid_grad = property $
25− blindForAll genShape >>= \case
25+ forAllWith rss genShape >>= \case
26 (SomeSing (r :: Sing s)) ->
26 (SomeSing (r :: Sing s)) ->
27 withSingI r $
27 withSingI r $
28 blindForAll genOfShape >>= \(ds :: S s) ->
28 blindForAll genOfShape >>= \(ds :: S s) ->
@@ -37,7 +37,7 @@ prop_sigmoid_grad = property $
37
37
38prop_tanh_grad :: Property
38prop_tanh_grad :: Property
39prop_tanh_grad = property $
39prop_tanh_grad = property $
40− blindForAll genShape >>= \case
40+ forAllWith rss genShape >>= \case
41 (SomeSing (r :: Sing s)) ->
41 (SomeSing (r :: Sing s)) ->
42 withSingI r $
42 withSingI r $
43 blindForAll genOfShape >>= \(ds :: S s) ->
43 blindForAll genOfShape >>= \(ds :: S s) ->
@@ -51,5 +51,4 @@ prop_tanh_grad = property $
51 (S3D x) -> norm_Inf x < 0.001) :: Bool)
51 (S3D x) -> norm_Inf x < 0.001) :: Bool)
52
52
53tests :: IO Bool
53tests :: IO Bool
54−tests = $$(checkConcurrent)
54+tests = checkParallel $$(discover)
55−
test/Test/Grenade/Layers/PadCrop.hs+1−1
@@ -50,4 +50,4 @@ prop_pad_crop_2d =
50
50
51
51
52tests :: IO Bool
52tests :: IO Bool
53−tests = $$(checkConcurrent)
53+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Pooling.hs+1−1
@@ -42,4 +42,4 @@ prop_pool_layer_witness =
42 assert True
42 assert True
43
43
44tests :: IO Bool
44tests :: IO Bool
45−tests = $$(checkConcurrent)
45+tests = checkParallel $$(discover)
test/Test/Grenade/Network.hs+1−1
@@ -303,4 +303,4 @@ infix 4 ~~~
303
303
304
304
305tests :: IO Bool
305tests :: IO Bool
306−tests = $$(checkConcurrent)
306+tests = checkParallel $$(discover)
test/Test/Grenade/Recurrent/Layers/LSTM.hs+1−1
@@ -122,4 +122,4 @@ prop_lstm_reference_backwards_cell =
122infix 4 ~~~
122infix 4 ~~~
123
123
124tests :: IO Bool
124tests :: IO Bool
125−tests = $$(checkConcurrent)
125+tests = checkParallel $$(discover)
test/Test/Hedgehog/Compat.hs+2−4
@@ -9,8 +9,6 @@ module Test.Hedgehog.Compat (
9
9
10import Control.Monad.Trans.Class (MonadTrans(..))
10import Control.Monad.Trans.Class (MonadTrans(..))
11
11
12−import Data.Typeable ( typeOf )
13−
14import qualified Hedgehog.Gen as Gen
12import qualified Hedgehog.Gen as Gen
15import qualified Hedgehog.Range as Range
13import qualified Hedgehog.Range as Range
16import Hedgehog.Internal.Property
14import Hedgehog.Internal.Property
@@ -30,11 +28,11 @@ blindForAll = Test . lift . lift
30semiBlindForAll :: (Monad m, Show a, HasCallStack) => Gen.Gen m a -> Test m a
28semiBlindForAll :: (Monad m, Show a, HasCallStack) => Gen.Gen m a -> Test m a
31semiBlindForAll gen = do
29semiBlindForAll gen = do
32 x <- Test . lift $ lift gen
30 x <- Test . lift $ lift gen
33− writeLog $ Input (getCaller callStack) (typeOf ()) (showPretty x)
31+ annotate (showPretty x)
34 return x
32 return x
35
33
36forAllRender :: (Monad m, HasCallStack) => ( a -> String ) -> Gen.Gen m a -> Test m a
34forAllRender :: (Monad m, HasCallStack) => ( a -> String ) -> Gen.Gen m a -> Test m a
37forAllRender render gen = do
35forAllRender render gen = do
38 x <- Test . lift $ lift gen
36 x <- Test . lift $ lift gen
39− writeLog $ Input (getCaller callStack) (typeOf ()) (render x)
37+ footnote (render x)
40 return x
38 return x
test/Test/Hedgehog/TypeLits.hs+6
@@ -62,3 +62,9 @@ genD3 = do
62 (SomeNat (px :: Proxy x), SomeNat (_ :: Proxy y), SomeNat (pz :: Proxy z)) ->
62 (SomeNat (px :: Proxy x), SomeNat (_ :: Proxy y), SomeNat (pz :: Proxy z)) ->
63 case natDict px %* natDict pz of
63 case natDict px %* natDict pz of
64 Dict -> SomeSing (sing :: Sing ('D3 x y z))
64 Dict -> SomeSing (sing :: Sing ('D3 x y z))
65+
66+rss :: SomeSing Shape' -> String
67+rss (SomeSing (r :: Sing s)) = case r of
68+ (D1Sing a@SNat) -> "D1 " ++ show (natVal a)
69+ (D2Sing a@SNat b@SNat) -> "D2 " ++ show (natVal a) ++ " " ++ show (natVal b)
70+ (D3Sing a@SNat b@SNat c@SNat) -> "D3 " ++ show (natVal a) ++ " " ++ show (natVal b) ++ " " ++ show (natVal c)