1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Decrease the frequency of newlines & carriage returns.

This commit is contained in:
Rob Rix 2019-08-02 15:59:53 -04:00
parent e9eecddca5
commit 99b1287f2c
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 2 additions and 2 deletions

View File

@ -101,5 +101,5 @@ insetRange Range {..} = Range (succ start) (pred end)
instance QC.Arbitrary Source where
arbitrary = fromText . Text.pack <$> QC.listOf (QC.oneof [ pure '\r', pure '\n', QC.arbitraryUnicodeChar ])
arbitrary = fromText . Text.pack <$> QC.listOf (QC.frequency [ (1, pure '\r'), (1, pure '\n'), (20, QC.arbitraryUnicodeChar) ])
shrink src = fromText . Text.pack <$> QC.shrinkList QC.shrinkNothing (Text.unpack (toText src))

View File

@ -9,4 +9,4 @@ import qualified Data.Source
import Data.Functor.Identity
source :: (GenBase m ~ Identity, MonadGen m) => Hedgehog.Range Int -> m Data.Source.Source
source r = Data.Source.fromUTF8 <$> Gen.utf8 r (Gen.choice [pure '\r', pure '\n', Gen.unicode])
source r = Data.Source.fromUTF8 <$> Gen.utf8 r (Gen.frequency [ (1, pure '\r'), (1, pure '\n'), (20, Gen.unicode) ])