mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
d6b4c8e4ef
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>
(cherry picked from commit 543f218fe9
)
Signed-off-by: hagen1778 <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")
|
|
}
|