Update tests.

This commit is contained in:
Benjamin Summers 2019-12-19 06:13:20 -08:00
parent ce193616b4
commit 849410e1fe
2 changed files with 8 additions and 4 deletions

View File

@ -113,8 +113,8 @@ twoTalk = forAll arbitrary (ioProperty . runNetworkApp . runTest)
go aliceShip bobShip val = runRAcquire $ do
(aliceQ, alice) <- runGala aliceShip
(bobQ, bob) <- runGala bobShip
sendThread alice (Galaxy bobShip, val)
sendThread bob (Galaxy aliceShip, val)
sendThread alice (Patp bobShip, val)
sendThread bob (Patp aliceShip, val)
liftIO (waitForPacket aliceQ val >> waitForPacket bobQ val)
tests :: TestTree
@ -140,10 +140,12 @@ instance Arbitrary Ipv4 where arbitrary = Ipv4 <$> arb
instance Arbitrary Port where arbitrary = Port <$> arb
instance Arbitrary Wen where arbitrary = Wen <$> arb
instance Arbitrary Gap where arbitrary = Gap . abs <$> arb
instance Arbitrary Galaxy where arbitrary = Galaxy <$> arb
instance Arbitrary Bytes where arbitrary = pure (MkBytes "wtfbbq")
-- MkBytes . take 100 <$> arb
instance Arbitrary a => Arbitrary (Patp a) where
arbitrary = Patp <$> arb
instance Arbitrary ByteString where
arbitrary = pack <$> arbitrary

View File

@ -85,11 +85,13 @@ instance Arbitrary File where arbitrary = File <$> arb
instance Arbitrary Cord where arbitrary = Cord <$> arb
instance Arbitrary Wen where arbitrary = Wen <$> arb
instance Arbitrary Gap where arbitrary = Gap . abs <$> arb
instance Arbitrary Galaxy where arbitrary = Galaxy <$> arb
instance Arbitrary Port where arbitrary = Port <$> arb
instance Arbitrary Ship where arbitrary = Ship <$> arb
instance Arbitrary Address where arbitrary = AAmes <$> arb
instance Arbitrary a => Arbitrary (Patp a) where
arbitrary = Patp <$> arb
genIpv4 :: Gen Ipv4
genIpv4 = do
x <- arbitrary