Skip to content

Commit

Permalink
#32, add a test that rendering the prefix of an infinite document pro…
Browse files Browse the repository at this point in the history
…duces some result
  • Loading branch information
ndmitchell committed Jun 2, 2016
1 parent bbe9270 commit a5c916a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions pretty.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Test-Suite test-pretty
UnitLargeDoc
UnitPP1
UnitT3911
UnitT32
extensions: CPP, BangPatterns, DeriveGeneric
include-dirs: src/Text/PrettyPrint/Annotated
ghc-options: -rtsopts -with-rtsopts=-K2M
Expand Down
2 changes: 2 additions & 0 deletions tests/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import TestStructures
import UnitLargeDoc
import UnitPP1
import UnitT3911
import UnitT32

import Control.Monad
import Data.Char (isSpace)
Expand All @@ -39,6 +40,7 @@ main = do
-- unit tests
testPP1
testT3911
testT32
testLargeDoc

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
9 changes: 9 additions & 0 deletions tests/UnitT32.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Test from https://github.com/haskell/pretty/issues/32#issuecomment-223073337
module UnitT32 where

import Text.PrettyPrint.HughesPJ

import TestUtils

testT32 :: IO ()
testT32 = simpleMatch "T3911" (replicate 10 'x') $ take 10 $ render $ hcat $ repeat $ text "x"

0 comments on commit a5c916a

Please sign in to comment.