mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-16 07:34:45 +03:00
4220c644cf
* support for system command via node backend. * Add env var set/unset * fix env unset function * Update libs/base/System.idr * modify system test to cover node and chez. * Add base tests for env get/set
19 lines
470 B
Idris
19 lines
470 B
Idris
import System
|
|
|
|
main : IO ()
|
|
main = do
|
|
printLn !(getEnv "HELLO")
|
|
True <- setEnv "WORLD" "world" False
|
|
| _ => putStrLn "Failed to set ENV 1"
|
|
printLn !(getEnv "WORLD")
|
|
True <- setEnv "WORLD" "other world" False
|
|
| _ => putStrLn "Failed to set ENV 2"
|
|
-- ^ should not overwrite
|
|
printLn !(getEnv "WORLD")
|
|
True <- setEnv "WORLD" "third rock from sun" True
|
|
| _ => putStrLn "Failed to set ENV 3"
|
|
printLn !(getEnv "WORLD")
|
|
|
|
printLn !(getEnv "UNSET")
|
|
|