mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
Test System.system
This commit is contained in:
parent
4fdec0682e
commit
fb1d118b2d
@ -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"
|
||||
|
11
tests/base/system_system/Test.idr
Normal file
11
tests/base/system_system/Test.idr
Normal 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 ()
|
5
tests/base/system_system/expected
Normal file
5
tests/base/system_system/expected
Normal file
@ -0,0 +1,5 @@
|
||||
1/1: Building Test (Test.idr)
|
||||
Main> ZERO
|
||||
SEVENTEEN
|
||||
Main>
|
||||
Bye for now!
|
1
tests/base/system_system/input
Normal file
1
tests/base/system_system/input
Normal file
@ -0,0 +1 @@
|
||||
:exec main
|
3
tests/base/system_system/run
Executable file
3
tests/base/system_system/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --no-color --console-width 0 --no-banner Test.idr < input
|
||||
|
||||
rm -rf build
|
4
tests/base/system_system/seventeen.sh
Normal file
4
tests/base/system_system/seventeen.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo "SEVENTEEN"
|
||||
exit 17
|
4
tests/base/system_system/zero.sh
Normal file
4
tests/base/system_system/zero.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo "ZERO"
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user