on master help sign in
Add test for :exec (+ fix for test/README.md)
commitfa0d47c41d19b51f1bdfece5e554cc62f7129069 authorJonas De Vuyst <jdv@foobar.be> dateSun 14 May 2017, 18:56 (9 years ago) parent788f960
6 files changed+27−7
test/README.md−6 test/TestData.hs+2−1 test/interactive014/expected+7 test/interactive014/input+5 test/interactive014/interactive014.idr+10 test/interactive014/run+3
test/README.md−6
@@ -124,12 +124,6 @@ and somewhat self-explanatory.
124124 stack test --test-arguments="--pattern foo042 --accept"
125125 ```
1261268. Check the content of `expected`. Maybe the test didn't do what you thought it would. Fix and go back to 7 until it's ok.
127−9. Add under `Extra-source-files` in `idris.cabal` the patterns that match the folder's content. If you forget this, your test will fail in Travis CI. With the previous example, it should be at least:
128− ```
129− test/foo042/run
130− test/foo042/expected
131− test/foo042/*.idr
132− ```
133127
134128### Specifying compatible backends
135129
test/TestData.hs+2−1
@@ -153,7 +153,8 @@ testFamiliesData = [
153153 ( 10, ANY ),
154154 ( 11, ANY ),
155155 ( 12, ANY ),
156− ( 13, ANY )]),
156+ ( 13, ANY ),
157+ ( 14, ANY )]),
157158 ("interfaces", "Interfaces",
158159 [ ( 1, ANY ),
159160 ( 2, ANY ),
test/interactive014/expectednew file+7
@@ -0,0 +1,7 @@
1+aa
2+bb
3+123
4+cc
5+"dd"
6+456
7+"xyz"
test/interactive014/inputnew file+5
@@ -0,0 +1,5 @@
1+:exec voidIO
2+:exec intIO
3+:exec stringIO
4+:exec 456
5+:exec "xyz"
test/interactive014/interactive014.idrnew file+10
@@ -0,0 +1,10 @@
1+voidIO : IO ()
2+voidIO = do putStrLn "aa"
3+
4+intIO : IO Int
5+intIO = do putStrLn "bb"
6+ pure 123
7+
8+stringIO : IO String
9+stringIO = do putStrLn "cc"
10+ pure "dd"
test/interactive014/runnew file+3
@@ -0,0 +1,3 @@
1+#!/usr/bin/env bash
2+${IDRIS:-idris} $@ --quiet --port none interactive014.idr < input
3+rm -f *.ibc