@@ -1,11 +1,9 @@
11{-# LANGUAGE OverloadedStrings #-}
22{-# LANGUAGE TypeApplications #-}
33
4−import Data.Proxy (Proxy (..))
54import qualified Foo
65import Hedgehog (Group (..), checkSequential)
76import qualified Roboservant as RS
8−import Servant (Endpoints)
97import qualified UnsafeIO
108
119-- | this is pretty bad. hopefully Jacob knows a better way of doing this.
@@ -17,15 +15,13 @@ assert err False = ioError $ userError err
1715-- | This is horribly laid out, sorry. Will fix at some point.
1816main :: IO ()
1917main = do
20− let reifiedApi = RS.toReifiedApi (RS.flattenServer @Foo.FooApi Foo.fooServer) (Proxy @(Endpoints Foo.FooApi))
2118 assert "should find an error in Foo" . not
22− =<< checkSequential (Group "Foo" [("Foo", RS.prop_sequential reifiedApi)])
19+ =<< checkSequential (Group "Foo" [("Foo", RS.prop_sequential @Foo.FooApi Foo.fooServer)])
2320 -- The UnsafeIO checker does not actually really use the contextually aware stuff, though it
2421 -- could: it's mostly here to show how to test for concurrency problems.
2522 unsafeServer <- UnsafeIO.makeServer
26− let unsafeApi = RS.toReifiedApi (RS.flattenServer @UnsafeIO.UnsafeApi unsafeServer) (Proxy @(Endpoints UnsafeIO.UnsafeApi))
2723 -- this will not detect the error, as it requires concurrency.
28− assert "should find nothing" =<< checkSequential (Group "Unsafe" [("Sequential", RS.prop_sequential unsafeApi)])
24+ assert "should find nothing" =<< checkSequential (Group "Unsafe" [("Sequential", RS.prop_sequential @UnsafeIO.UnsafeApi unsafeServer)])
2925 -- this will!
3026 assert "should find with parallel check" . not
31− =<< checkSequential (Group "Unsafe" [("Parallel", RS.prop_concurrent unsafeApi)])
27+ =<< checkSequential (Group "Unsafe" [("Parallel", RS.prop_concurrent @UnsafeIO.UnsafeApi unsafeServer)])