Add regression test for possibly-null foreign strings in the executor

This commit is contained in:
Melvar Chen 2013-12-20 20:55:22 +01:00
parent 3e19367012
commit 2fe2eca105
5 changed files with 23 additions and 0 deletions

View File

@ -177,6 +177,9 @@ Extra-source-files:
test/reg024/run
test/reg024/*.idr
test/reg024/expected
test/reg029/run
test/reg029/*.idr
test/reg029/expected
test/test001/run
test/test001/*.idr
test/test001/expected

View File

@ -37,4 +37,5 @@ Tests:
regxxx: various regression tests
reg020: working strlen
reg029: executor doesnt crash receiving a NULL String from C

4
test/reg029/expected Normal file
View File

@ -0,0 +1,4 @@
Nothing
Just "exists!"
Nothing
Just "exists!"

10
test/reg029/reg029.idr Normal file
View File

@ -0,0 +1,10 @@
module Main
import System
%dynamic "libm"
main : IO ()
main = do
print !(getEnv "IDRIS_REG029_NONEXISTENT_VAR")
print !(getEnv "IDRIS_REG029_EXISTENT_VAR")

5
test/reg029/run Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
idris $@ reg029.idr -o reg029
env -u IDRIS_REG029_NONEXISTENT_VAR IDRIS_REG029_EXISTENT_VAR='exists!' ./reg029
env -u IDRIS_REG029_NONEXISTENT_VAR IDRIS_REG029_EXISTENT_VAR='exists!' idris $@ reg029.idr --exec
rm -f reg029 *.ibc