MCPcopy Create free account
hub / github.com/WhyWhatHow/jenv / TestQuerySystemEnvironmentVariable

Function TestQuerySystemEnvironmentVariable

src/internal/env/env_windows_test.go:19–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestQuerySystemEnvironmentVariable(t *testing.T) {
20 // 测试查询系统级别的环境变量
21 key := "PATH"
22 value, err := QuerySystemEnvironmentVariable(key)
23 if err != nil {
24 t.Fatalf("QuerySystemEnvironmentVariable failed: %v", err)
25 }
26 if value == "" {
27 t.Errorf("Expected non-empty value for key %s, got empty string", key)
28 }
29}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected