mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-24 11:20:18 +01:00
543f218fe9
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com> Co-authored-by: Nikolay <https://github.com/f41gh7> Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
23 lines
532 B
Go
23 lines
532 B
Go
package datadog
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSplitTag(t *testing.T) {
|
|
f := func(s, nameExpected, valueExpected string) {
|
|
t.Helper()
|
|
name, value := SplitTag(s)
|
|
if name != nameExpected {
|
|
t.Fatalf("unexpected name obtained from %q; got %q; want %q", s, name, nameExpected)
|
|
}
|
|
if value != valueExpected {
|
|
t.Fatalf("unexpected value obtained from %q; got %q; want %q", s, value, valueExpected)
|
|
}
|
|
}
|
|
f("", "", "no_label_value")
|
|
f("foo", "foo", "no_label_value")
|
|
f("foo:bar", "foo", "bar")
|
|
f(":bar", "", "bar")
|
|
}
|