From a4c9375d5f666098de201b7b05ff433570593ad2 Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan <bos@serpentine.com> Date: Sat, 20 May 2017 22:11:25 -0700 Subject: [PATCH] Make the Arbitrary instance for Text generate full Unicode Flipping this revealed one genuine codebase bug, but gh-176 may be related. And as a bonus, this also revealed two testsuite bugs. That's an impressive haul! --- tests/Tests/QuickCheckUtils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tests/QuickCheckUtils.hs b/tests/Tests/QuickCheckUtils.hs index 63332717..851b6588 100644 --- a/tests/Tests/QuickCheckUtils.hs +++ b/tests/Tests/QuickCheckUtils.hs @@ -106,7 +106,7 @@ smallArbitrary = sized $ \n -> resize (smallish n) arbitrary where smallish = round . (sqrt :: Double -> Double) . fromIntegral . abs instance Arbitrary T.Text where - arbitrary = T.pack `fmap` arbitrary + arbitrary = T.pack `fmap` string shrink = map T.pack . shrink . T.unpack instance Arbitrary TL.Text where -- GitLab