@@ -95,17 +95,20 @@ genUnicode = fmap fromString string where
9595
9696 char = chr `fmap` excluding reserved (oneof planes)
9797
98−instance Arbitrary T.Text where
99− arbitrary = T.pack `fmap` arbitrary
100−
10198-- For tests that have O(n^2) running times or input sizes, resize
10299-- their inputs to the square root of the originals.
103100unsquare :: (Arbitrary a, Show a, Testable b) => (a -> b) -> Property
104−unsquare = forAll . sized $ \n -> resize (smallish n) arbitrary
105− where smallish = round . (sqrt :: Double -> Double) . fromIntegral
101+unsquare = forAll smallArbitrary
102+
103+smallArbitrary :: (Arbitrary a, Show a) => Gen a
104+smallArbitrary = sized $ \n -> resize (smallish n) arbitrary
105+ where smallish = round . (sqrt :: Double -> Double) . fromIntegral . abs
106+
107+instance Arbitrary T.Text where
108+ arbitrary = T.pack `fmap` arbitrary
106109
107110instance Arbitrary TL.Text where
108− arbitrary = (TL.fromChunks . map notEmpty) `fmap` arbitrary
111+ arbitrary = (TL.fromChunks . map notEmpty) `fmap` smallArbitrary
109112
110113newtype NotEmpty a = NotEmpty { notEmpty :: a }
111114 deriving (Eq, Ord)