Skip to content

Commit fe3b24a

Browse files
committed
Add test for environment variable with empty value
1 parent ec482e2 commit fe3b24a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

goos/api_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ func TestApi(t *testing.T) {
1414
os.Setenv("ENV_VAR", "TEST=1")
1515
defer os.Unsetenv("ENV_VAR")
1616

17+
os.Setenv("EMPTY_VAR", "")
18+
defer os.Unsetenv("EMPTY_VAR")
19+
1720
preload := tests.SeveralPreloadFuncs(
1821
runtime.Preload,
1922
Preload,

goos/test/test_api.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ function Test_environ(t)
3535
assert(env.PATH or env.Path, "PATH environment variable should exist")
3636
-- Test environment variable with equals sign in value
3737
assert(env.ENV_VAR == "TEST=1", "ENV_VAR should be TEST=1")
38+
-- Test environment variable with empty value
39+
assert(env.EMPTY_VAR == "", "EMPTY_VAR should be empty string")
3840
end

0 commit comments

Comments
 (0)