@@ 1,6 1,9 @@
{-# OPTIONS_GHC -fno-warn-deprecations #-}
module Data.Text.ParagraphLayout.PlainSpec (spec) where
+import Control.Monad (forM_)
+import Data.Int (Int32)
+
import Test.Hspec
import System.FilePath ((</>))
import Data.Text.ParagraphLayout
@@ 155,6 158,13 @@ spec = do
let result = layoutPlain $ czechHelloParagraph opts
result `shouldBeGolden` "czechHelloParagraphUltraNarrow"
+ focus $ describe "ultra narrow line stress test" $
+ ([(-1),(-2)..(-999)] :: [Int32]) `forM_` \w ->
+ it ("h = " ++ show w) $ do
+ let opts = opts_ { paragraphMaxWidth = w }
+ let result = layoutPlain $ czechHelloParagraph opts
+ result `shouldBeGolden` "czechHelloParagraphUltraNarrow"
+
it "wraps lorem ipsum at 20em" $ do
let opts = opts_ { paragraphMaxWidth = 20000 }
let result = layoutPlain $ loremIpsumParagraph opts