diff options
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/os/env_test.go')
| -rw-r--r-- | llgo/third_party/gofrontend/libgo/go/os/env_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/os/env_test.go b/llgo/third_party/gofrontend/libgo/go/os/env_test.go index e6180675137..d1074cdc60a 100644 --- a/llgo/third_party/gofrontend/libgo/go/os/env_test.go +++ b/llgo/third_party/gofrontend/libgo/go/os/env_test.go @@ -94,3 +94,20 @@ func TestUnsetenv(t *testing.T) { t.Fatal("Unsetenv didn't clear TestUnsetenv") } } + +func TestLookupEnv(t *testing.T) { + const smallpox = "SMALLPOX" // No one has smallpox. + value, ok := LookupEnv(smallpox) // Should not exist. + if ok || value != "" { + t.Fatalf("%s=%q", smallpox, value) + } + defer Unsetenv(smallpox) + err := Setenv(smallpox, "virus") + if err != nil { + t.Fatalf("failed to release smallpox virus") + } + value, ok = LookupEnv(smallpox) + if !ok { + t.Errorf("smallpox release failed; world remains safe but LookupEnv is broken") + } +} |

