Files
c3c/test/unit/stdlib/os/env.c3
2023-09-25 16:29:49 +02:00

17 lines
361 B
C

module std::os::env @test;
fn void! set_get_unset()
{
const NAME = "C3_TEST_ENVVAR";
const VALUE = "foobar";
env::set_var(NAME, VALUE);
String v = env::get_var(NAME)!;
assert(v == VALUE, "got %s; want %s", v, VALUE);
env::clear_var(NAME);
if (try env::get_var(NAME))
{
assert(false, "environment variable should no longer exist");
}
}