MCPcopy
hub / github.com/direnv/direnv / TestEnv

Function TestEnv

internal/cmd/env_test.go:7–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestEnv(t *testing.T) {
8 env := Env{"FOO": "bar"}
9
10 out := env.Serialize()
11
12 env2, err := LoadEnv(out)
13 if err != nil {
14 t.Error("parse error", err)
15 }
16
17 if env2["FOO"] != "bar" {
18 t.Error("FOO != bar", env2["FOO"])
19 }
20
21 if len(env2) != 1 {
22 t.Error("len != 1", len(env2))
23 }
24}

Callers

nothing calls this directly

Calls 3

SerializeMethod · 0.95
LoadEnvFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected