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:
parent
e9eecddca5
commit
99b1287f2c
@ -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))
|
||||
|
@ -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) ])
|
||||
|
Loading…
Reference in New Issue
Block a user