Idris2/tests/base/system_env/Test.idr
Mathew Polzin 4220c644cf
Add a few missing NodeJS FFI functions to System (#2271)
* 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
2022-01-18 22:43:03 -08:00

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")