Test System.system

This commit is contained in:
Stiopa Koltsov 2021-06-30 00:12:10 +01:00 committed by G. Allais
parent 4fdec0682e
commit fb1d118b2d
7 changed files with 29 additions and 0 deletions

View File

@ -288,6 +288,7 @@ baseLibraryTests : TestPool
baseLibraryTests = MkTestPool "Base library" [Chez, Node] Nothing
[ "system_file001"
, "system_info_os001"
, "system_system"
, "data_bits001"
, "system_info001"
, "system_signal001", "system_signal002", "system_signal003", "system_signal004"

View File

@ -0,0 +1,11 @@
import System
main : IO ()
main = do
0 <- system "bash zero.sh"
| r => do putStrLn ("expecting zero, got " ++ (show r))
exitFailure
-- `system` returns result of `waitpid` which is not trivial to decode
let True = !(system "bash seventeen.sh") /= 0
| False => putStrLn "expecting 17, got zero"
pure ()

View File

@ -0,0 +1,5 @@
1/1: Building Test (Test.idr)
Main> ZERO
SEVENTEEN
Main>
Bye for now!

View File

@ -0,0 +1 @@
:exec main

3
tests/base/system_system/run Executable file
View File

@ -0,0 +1,3 @@
$1 --no-color --console-width 0 --no-banner Test.idr < input
rm -rf build

View File

@ -0,0 +1,4 @@
#!/bin/sh -e
echo "SEVENTEEN"
exit 17

View File

@ -0,0 +1,4 @@
#!/bin/sh -e
echo "ZERO"
exit 0