summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorpharpend <>2015-05-16 18:47:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-05-16 18:47:00 (GMT)
commit9e631636f8284f6163fdff7eddee2902cfaeb5f9 (patch)
tree48f4eb80847d23641cda853c72565f56f7cd85fa /test
parent2bebe448d9f167367d5ef84de93affa781360a13 (diff)
version 0.1.1.0HEAD0.1.1.0master
Diffstat (limited to 'test')
-rw-r--r--test/main.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/main.hs b/test/main.hs
index 67ced70..997d209 100644
--- a/test/main.hs
+++ b/test/main.hs
@@ -1,8 +1,13 @@
import qualified Data.ByteString.Lazy as B
+import qualified Data.Text.IO as TIO
import Data.Conduit.Binary
import Paths_pager
import System.Pager
+testPrintOrPage :: FilePath -> IO ()
+testPrintOrPage fnom =
+ TIO.readFile fnom >>= printOrPage
+
testConduit :: FilePath -> IO ()
testConduit fnom =
sendToPagerConduit (sourceFile fnom)
@@ -10,6 +15,7 @@ testConduit fnom =
test :: FilePath -> IO ()
test fp = B.readFile fp >>= sendToPager
+main :: IO ()
main =
do fnom <- getDataFileName "LICENSE"
putStrLn "Hit Return to start the conduit-free test"
@@ -18,3 +24,6 @@ main =
putStrLn "Hit Return to start the conduit test"
_ <- getLine
testConduit fnom
+ putStrLn "Hit Return to start the printOrPage test (no conduits)"
+ _ <- getLine
+ testPrintOrPage fnom