~jaro/balkon

f72b5805e6f857d963bf025d464a86a80b9374b1 — Jaro 11 months ago c072603 segfault-debug
Add stress test for Heisenbug hunting.
1 files changed, 10 insertions(+), 0 deletions(-)

M test/Data/Text/ParagraphLayout/PlainSpec.hs
M test/Data/Text/ParagraphLayout/PlainSpec.hs => test/Data/Text/ParagraphLayout/PlainSpec.hs +10 -0
@@ 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