File tree Expand file tree Collapse file tree
prettyprinter/test/Testsuite Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ tests = testGroup "Tests"
5353 groupingPerformance
5454 , testCase " fillSep performance"
5555 fillSepPerformance
56+ , testCase " Issue 205"
57+ issue205
5658 ]
5759 , testGroup " Regression tests"
5860 [ testCase " layoutSmart: softline behaves like a newline (#49)"
@@ -285,6 +287,14 @@ fillSepPerformance = docPerformanceTest (pathological 1000)
285287 pathological :: Int -> Doc ann
286288 pathological n = iterate (\ x -> fillSep [" a" , x <+> " b" ] ) " foobar" !! n
287289
290+ issue205 :: Assertion
291+ issue205 = do
292+ let doc = fillSep (replicate 30 (sep [" abc" , " xyz" :: Doc () ]))
293+ t = renderStrict (layoutSmart defaultLayoutOptions doc)
294+ timeout 1000000 (evaluate t) >>= \ t' -> case t' of
295+ Nothing -> assertFailure " Timeout!"
296+ Just _success -> pure ()
297+
288298regressionLayoutSmartSoftline :: Assertion
289299regressionLayoutSmartSoftline
290300 = let doc = " a" <> softline <> " b"
You can’t perform that action at this time.
0 commit comments