Skip to content

Commit 812d8c0

Browse files
committed
Tests.QuickCheckUtils: i Arbitrary Text: refactor
Decided to look into it because Text was using String generator. And that is a strange beginning for Text. Then String, better to depend on list as a classical lazy generator. And then even list can be updated to other builder if needed. There was rewrapping play on internal `arbitrary` types&functions. This is the exactly same code, which got rewrapped manually, generation just classically derives from 'arbitraryUnicodeChar :: Gen Char'.
1 parent d72cf35 commit 812d8c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/Tests/QuickCheckUtils.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ instance Arbitrary a => Arbitrary (Sqrt a) where
8585
shrink = map Sqrt . shrink . unSqrt
8686

8787
instance Arbitrary T.Text where
88-
arbitrary = (T.pack . getUnicodeString) `fmap` arbitrary
88+
arbitrary = T.pack <$> listOf arbitraryUnicodeChar -- without surrogates
8989
shrink = map T.pack . shrink . T.unpack
9090

9191
instance Arbitrary TL.Text where

0 commit comments

Comments
 (0)