mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-11-14 03:14:14 +03:00
Add regression test for possibly-null foreign strings in the executor
This commit is contained in:
parent
3e19367012
commit
2fe2eca105
@ -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
|
||||
|
@ -37,4 +37,5 @@ Tests:
|
||||
|
||||
regxxx: various regression tests
|
||||
reg020: working strlen
|
||||
reg029: executor doesn’t crash receiving a NULL String from C
|
||||
|
||||
|
4
test/reg029/expected
Normal file
4
test/reg029/expected
Normal file
@ -0,0 +1,4 @@
|
||||
Nothing
|
||||
Just "exists!"
|
||||
Nothing
|
||||
Just "exists!"
|
10
test/reg029/reg029.idr
Normal file
10
test/reg029/reg029.idr
Normal 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
5
test/reg029/run
Executable 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
|
Loading…
Reference in New Issue
Block a user