diff options
Diffstat (limited to 'spec/src')
| -rw-r--r-- | spec/src/Thermoprint/Printout.hs | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/spec/src/Thermoprint/Printout.hs b/spec/src/Thermoprint/Printout.hs index 752ccb5..53b6a3e 100644 --- a/spec/src/Thermoprint/Printout.hs +++ b/spec/src/Thermoprint/Printout.hs | |||
| @@ -37,7 +37,7 @@ import Data.Proxy (Proxy(..)) | |||
| 37 | 37 | ||
| 38 | import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink) | 38 | import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink) | 
| 39 | import Test.QuickCheck.Modifiers (NonNegative(..)) | 39 | import Test.QuickCheck.Modifiers (NonNegative(..)) | 
| 40 | import Test.QuickCheck.Gen (oneof, scale) | 40 | import Test.QuickCheck.Gen (oneof, scale, elements) | 
| 41 | import Test.QuickCheck.Instances | 41 | import Test.QuickCheck.Instances | 
| 42 | import Test.QuickCheck (forAll, Property) | 42 | import Test.QuickCheck (forAll, Property) | 
| 43 | 43 | ||
| @@ -242,10 +242,14 @@ data MarkupMode = Bold | |||
| 242 | | Underline | 242 | | Underline | 
| 243 | | DoubleHeight | 243 | | DoubleHeight | 
| 244 | | DoubleWidth | 244 | | DoubleWidth | 
| 245 | deriving (Generic, NFData, Show, Arbitrary, CoArbitrary, FromJSON, ToJSON | 245 | deriving (Generic, NFData, Show, FromJSON, ToJSON | 
| 246 | , Eq, Ord, Enum | 246 | , Eq, Ord, Enum, Bounded | 
| 247 | ) | 247 | ) | 
| 248 | 248 | ||
| 249 | instance Arbitrary MarkupMode where | ||
| 250 | arbitrary = elements [minBound..maxBound] | ||
| 251 | instance CoArbitrary MarkupMode | ||
| 252 | |||
| 249 | -- | We don't test 'Raw' 'Chunk's | 253 | -- | We don't test 'Raw' 'Chunk's | 
| 250 | instance Arbitrary Chunk where | 254 | instance Arbitrary Chunk where | 
| 251 | shrink = genericShrink | 255 | shrink = genericShrink | 
| @@ -262,6 +266,7 @@ instance Arbitrary Line where | |||
| 262 | shrink = genericShrink | 266 | shrink = genericShrink | 
| 263 | arbitrary = oneof [ Word . TL.filter (not . isSpace) <$> arbitrary -- 'isSpace '\n' == True' | 267 | arbitrary = oneof [ Word . TL.filter (not . isSpace) <$> arbitrary -- 'isSpace '\n' == True' | 
| 264 | , HSpace . getNonNegative <$> arbitrary | 268 | , HSpace . getNonNegative <$> arbitrary | 
| 269 | , Markup <$> arbitrary <*> arbitrary | ||
| 265 | , JuxtaPos <$> scale' arbitrary | 270 | , JuxtaPos <$> scale' arbitrary | 
| 266 | ] | 271 | ] | 
| 267 | 272 | ||
