[commit: packages/pretty] large_docs: Clean up UnitLargeDoc style to be like rest of test-suite (b036410)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 22:50:14 UTC 2015


Repository : ssh://git@git.haskell.org/pretty

On branch  : large_docs
Link       : http://git.haskell.org/packages/pretty.git/commitdiff/b0364100bf58126dfe34715843102b27850d8f36

>---------------------------------------------------------------

commit b0364100bf58126dfe34715843102b27850d8f36
Author: David Terei <code at davidterei.com>
Date:   Fri Dec 26 00:26:42 2014 -0800

    Clean up UnitLargeDoc style to be like rest of test-suite


>---------------------------------------------------------------

b0364100bf58126dfe34715843102b27850d8f36
 pretty.cabal             |  2 +-
 tests/Test.hs            | 18 +++++-------------
 tests/TestLargePretty.hs |  7 -------
 tests/UnitLargeDoc.hs    | 16 ++++++++++++++++
 4 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/pretty.cabal b/pretty.cabal
index 1109617..8b81005 100644
--- a/pretty.cabal
+++ b/pretty.cabal
@@ -51,7 +51,7 @@ Test-Suite test-pretty
         TestStructures
         UnitPP1
         UnitT3911
-        TestLargePretty
+        UnitLargeDoc
     extensions: CPP, BangPatterns, DeriveGeneric
     include-dirs: src/Text/PrettyPrint
 
diff --git a/tests/Test.hs b/tests/Test.hs
index f9cb025..79e5a49 100644
--- a/tests/Test.hs
+++ b/tests/Test.hs
@@ -14,12 +14,11 @@
 import PrettyTestVersion
 import TestGenerators
 import TestStructures
-import TestLargePretty
 
+import UnitLargeDoc
 import UnitPP1
 import UnitT3911
 
-import Control.Exception
 import Control.Monad
 import Data.Char (isSpace)
 import Data.List (intersperse)
@@ -29,15 +28,18 @@ import Test.QuickCheck
 
 main :: IO ()
 main = do
+    -- quickcheck tests
     check_laws
     check_invariants
     check_improvements
     check_non_prims -- hpc full coverage
     check_rendering
     check_list_def
+    
+    -- unit tests
     testPP1
     testT3911
-    large_doc
+    testLargeDoc
 
 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 -- Utility functions
@@ -65,16 +67,6 @@ myAssert :: String -> Bool -> IO ()
 myAssert msg b = putStrLn $ (if b then "Ok, passed " else "Failed test:\n  ") ++ msg
 
 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- Ordinary tests
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-large_doc :: IO ()
-large_doc = do
-  putStrLn "Testing large doc..."
-  evaluate largeDocRender
-  return ()
-
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 -- Quickcheck tests
 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/tests/TestLargePretty.hs b/tests/TestLargePretty.hs
deleted file mode 100644
index 6d181c4..0000000
--- a/tests/TestLargePretty.hs
+++ /dev/null
@@ -1,7 +0,0 @@
-module TestLargePretty where
-
-import Text.PrettyPrint
-import Control.DeepSeq
-
-largeDocRender :: String
-largeDocRender = force $ render $ vcat $ replicate 10000000 $ text "Hello"
diff --git a/tests/UnitLargeDoc.hs b/tests/UnitLargeDoc.hs
new file mode 100644
index 0000000..5a44f34
--- /dev/null
+++ b/tests/UnitLargeDoc.hs
@@ -0,0 +1,16 @@
+module UnitLargeDoc where
+
+import Text.PrettyPrint.HughesPJ
+
+import Control.DeepSeq
+import Control.Exception
+
+testLargeDoc :: IO ()
+testLargeDoc = do
+  putStrLn "Testing large doc..."
+  evaluate largeDocRender
+  return ()
+
+largeDocRender :: String
+largeDocRender = force $ render $ vcat $ replicate 10000000 $ text "Hello"
+



More information about the ghc-commits mailing list