diff options
Diffstat (limited to 'spec/src')
-rw-r--r-- | spec/src/Thermoprint/Printout.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/src/Thermoprint/Printout.hs b/spec/src/Thermoprint/Printout.hs index 7c6d5c0..32c403c 100644 --- a/spec/src/Thermoprint/Printout.hs +++ b/spec/src/Thermoprint/Printout.hs | |||
@@ -149,12 +149,13 @@ cotext (Line x) = cotext' x | |||
149 | cotext' (HSpace n) = TL.pack . genericReplicate n $ ' ' | 149 | cotext' (HSpace n) = TL.pack . genericReplicate n $ ' ' |
150 | cotext' (SpaceSep xs) = TL.intercalate " " . map cotext' . toList $ xs | 150 | cotext' (SpaceSep xs) = TL.intercalate " " . map cotext' . toList $ xs |
151 | 151 | ||
152 | prop_text :: Property | 152 | prop_text :: Text -> Bool |
153 | -- ^ prop> cotext . either id Line . `text` $ x = x | 153 | -- ^ prop> (`cotext` . either id Line . `text` $ x) == x |
154 | -- | 154 | -- |
155 | -- Where 'x' is restricted to those `TL.Text` which do not contain whitespace besides ' ' and '\n'. | 155 | -- Where 'x' is restricted to those `TL.Text` which do not contain whitespace besides ' ' and '\n'. |
156 | prop_text = forAll (TL.map normSpace <$> arbitrary) $ \x -> (cotext . either id Line . text $ x) == x | 156 | prop_text x = (cotext . either id Line . text $ x') == x' |
157 | where | 157 | where |
158 | x' = TL.map normSpace x | ||
158 | normSpace c | 159 | normSpace c |
159 | | isSpace c | 160 | | isSpace c |
160 | , c `elem` keep = c | 161 | , c `elem` keep = c |