(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestExpandVariablesDisabled(t *testing.T) { |
| 142 | _ = os.Setenv("TEST_VAR", "test_value") |
| 143 | defer func() { _ = os.Unsetenv("TEST_VAR") }() |
| 144 | |
| 145 | loader := NewLoader(WithEnvExpansion(false)) |
| 146 | |
| 147 | // When expansion is disabled, expandVariables should still work |
| 148 | // but LoadFromString won't call it |
| 149 | result := loader.expandVariables("${TEST_VAR}") |
| 150 | if result != "test_value" { |
| 151 | t.Errorf("expected 'test_value', got %q", result) |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | func TestLoadFromString(t *testing.T) { |
| 156 | _ = os.Setenv("API_KEY", "sk-test-key") |
nothing calls this directly
no test coverage detected