on master help sign in
Add a test to demonstrate fix of PrettyPrint performance.
commite3a5c1468621ade03fa1d6c59f6d28899f3ddb75 authorJan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk> dateThu 9 Nov 2017, 11:25 (9 years ago) parent127c949
4 files changed+32
test/TestData.hs+2 test/contrib001/contrib001.idr+14 test/contrib001/expected+12 test/contrib001/run+4
test/TestData.hs+2
@@ -84,6 +84,8 @@ testFamiliesData = [
8484 [ ( 1, ANY )]),
8585 ("buffer", "Buffer",
8686 [ ( 1, C_CG )]),
87+ ("contrib", "Contrib",
88+ [ ( 1, C_CG )]),
8789 ("corecords", "Corecords",
8890 [ ( 1, ANY ),
8991 ( 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