(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestExpandVariablesWithPrefix(t *testing.T) { |
| 110 | _ = os.Setenv("APP_TEST_VAR", "prefixed_value") |
| 111 | defer func() { _ = os.Unsetenv("APP_TEST_VAR") }() |
| 112 | |
| 113 | loader := NewLoader(WithEnvPrefix("APP_")) |
| 114 | |
| 115 | result := loader.expandVariables("${TEST_VAR}") |
| 116 | if result != "prefixed_value" { |
| 117 | t.Errorf("expected 'prefixed_value', got %q", result) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func TestExpandVariablesWithCustomVariables(t *testing.T) { |
| 122 | loader := NewLoader(WithVariables(map[string]string{ |
nothing calls this directly
no test coverage detected