mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
c402265e88
Such placeholders are substituted by the corresponding environment variable values. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/583
19 lines
382 B
Go
19 lines
382 B
Go
package envtemplate
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestReplace(t *testing.T) {
|
|
f := func(s, resultExpected string) {
|
|
t.Helper()
|
|
result := Replace([]byte(s))
|
|
if string(result) != resultExpected {
|
|
t.Fatalf("unexpected result;\ngot\n%q\nwant\n%q", result, resultExpected)
|
|
}
|
|
}
|
|
f("", "")
|
|
f("foo", "foo")
|
|
f("%{foo}", "%{foo}")
|
|
f("foo %{bar} %{baz}", "foo %{bar} %{baz}")
|
|
}
|