MCPcopy Create free account
hub / github.com/astercloud/aster / TestExpandVariablesWithPrefix

Function TestExpandVariablesWithPrefix

pkg/config/loader_test.go:109–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func 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
121func TestExpandVariablesWithCustomVariables(t *testing.T) {
122 loader := NewLoader(WithVariables(map[string]string{

Callers

nothing calls this directly

Calls 3

expandVariablesMethod · 0.95
WithEnvPrefixFunction · 0.85
NewLoaderFunction · 0.70

Tested by

no test coverage detected