aboutsummaryrefslogtreecommitdiff
path: root/spec/src/Thermoprint/Printout.hs
diff options
context:
space:
mode:
Diffstat (limited to 'spec/src/Thermoprint/Printout.hs')
-rw-r--r--spec/src/Thermoprint/Printout.hs11
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
38import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink) 38import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink)
39import Test.QuickCheck.Modifiers (NonNegative(..)) 39import Test.QuickCheck.Modifiers (NonNegative(..))
40import Test.QuickCheck.Gen (oneof, scale) 40import Test.QuickCheck.Gen (oneof, scale, elements)
41import Test.QuickCheck.Instances 41import Test.QuickCheck.Instances
42import Test.QuickCheck (forAll, Property) 42import 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
249instance Arbitrary MarkupMode where
250 arbitrary = elements [minBound..maxBound]
251instance CoArbitrary MarkupMode
252
249-- | We don't test 'Raw' 'Chunk's 253-- | We don't test 'Raw' 'Chunk's
250instance Arbitrary Chunk where 254instance 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