on master help sign in
Interpreter tests (#3747)
515ac42Chris Ford
test/TestData.hs+3
@@ -162,6 +162,9 @@ testFamiliesData = [
162-- ( 5, ANY ),
162-- ( 5, ANY ),
163 ( 6, ANY ),
163 ( 6, ANY ),
164 ( 7, ANY )]),
164 ( 7, ANY )]),
165+ ("interpret", "Interpret",
166+ [ ( 1, ANY ),
167+ ( 2, ANY )]),
165 ("io", "IO monad",
168 ("io", "IO monad",
166 [ ( 1, C_CG ),
169 [ ( 1, C_CG ),
167 ( 2, ANY ),
170 ( 2, ANY ),
test/interpret001/double-echo.idrnew file+6
@@ -0,0 +1,6 @@
1+module Main
2+
3+main : IO ()
4+main = do l <- getLine
5+ let ll = l ++ l
6+ putStrLn ll
test/interpret001/expectednew file+2
@@ -0,0 +1,2 @@
1+testtest
2+MkIO (\w => prim_io_pure ()) : IO' (MkFFI C_Types String String) ()
test/interpret001/inputnew file+2
@@ -0,0 +1,2 @@
1+:x main
2+test
test/interpret001/runnew file+3
@@ -0,0 +1,3 @@
1+#!/usr/bin/env bash
2+${IDRIS:-idris} $@ --quiet --port none --nocolour double-echo.idr < input
3+rm -f *.ibc
test/interpret002/expectednew file+4
@@ -0,0 +1,4 @@
1+File Not Found
2+MkIO (\w => prim_io_pure ()) : IO' (MkFFI C_Types String String) ()
3+"readable"
4+MkIO (\w => prim_io_pure ()) : IO' (MkFFI C_Types String String) ()
test/interpret002/file-error.idrnew file+6
@@ -0,0 +1,6 @@
1+module Main
2+
3+echo : String -> IO ()
4+echo name = do Right contents <- readFile name
5+ | Left error => printLn error
6+ printLn contents
test/interpret002/inputnew file+2
@@ -0,0 +1,2 @@
1+:x echo "not a file"
2+:x echo "readable.txt"
test/interpret002/readable.txtnew file+1
@@ -0,0 +1 @@
1+readable
test/interpret002/runnew file+3
@@ -0,0 +1,3 @@
1+#!/usr/bin/env bash
2+${IDRIS:-idris} $@ --quiet --port none --nocolour file-error.idr < input
3+rm -f *.ibc