From 849410e1fe288019c56dbe420503493292e46f3a Mon Sep 17 00:00:00 2001 From: Benjamin Summers Date: Thu, 19 Dec 2019 06:13:20 -0800 Subject: [PATCH] Update tests. --- pkg/king/test/AmesTests.hs | 8 +++++--- pkg/king/test/ArvoTests.hs | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/king/test/AmesTests.hs b/pkg/king/test/AmesTests.hs index 6aedcea929..eb5e009b1c 100644 --- a/pkg/king/test/AmesTests.hs +++ b/pkg/king/test/AmesTests.hs @@ -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 diff --git a/pkg/king/test/ArvoTests.hs b/pkg/king/test/ArvoTests.hs index b4d81f8893..16cb2029c2 100644 --- a/pkg/king/test/ArvoTests.hs +++ b/pkg/king/test/ArvoTests.hs @@ -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