on master help sign in
Add a test to demonstrate fix of PrettyPrint performance.
e3a5c14Jan de Muijnck-Hughes
test/TestData.hs+2
@@ -84,6 +84,8 @@ testFamiliesData = [
84 [ ( 1, ANY )]),
84 [ ( 1, ANY )]),
85 ("buffer", "Buffer",
85 ("buffer", "Buffer",
86 [ ( 1, C_CG )]),
86 [ ( 1, C_CG )]),
87+ ("contrib", "Contrib",
88+ [ ( 1, C_CG )]),
87 ("corecords", "Corecords",
89 ("corecords", "Corecords",
88 [ ( 1, ANY ),
90 [ ( 1, ANY ),
89 ( 2, ANY )]),
91 ( 2, ANY )]),
test/contrib001/contrib001.idrnew file+14
@@ -0,0 +1,14 @@
1+module Main
2+
3+import Text.PrettyPrint.WL
4+
5+%default total
6+
7+myDoc : Doc
8+myDoc = fold (|//|) $ map text $ words "this is a long sentence with a lot of words that I can use for testing the performance of the prettier printer implementation. I need a few more words to prove my point, though."
9+
10+myString : String
11+myString = toString 0 15 $ myDoc
12+
13+main : IO ()
14+main = putStrLn myString
test/contrib001/expectednew file+12
@@ -0,0 +1,12 @@
1+thisisalong
2+sentencewitha
3+lotofwordsthatI
4+canusefor
5+testingthe
6+performanceof
7+theprettier
8+printer
9+implementation.
10+Ineedafewmore
11+wordstoprovemy
12+point,though.
test/contrib001/runnew file+4
@@ -0,0 +1,4 @@
1+#!/usr/bin/env bash
2+${IDRIS:-idris} $@ contrib001.idr -o contrib001 -p contrib
3+./contrib001
4+rm -f contrib001 *.ibc