MCPcopy Create free account
hub / github.com/prometheus/common / TestNewTextParser

Function TestNewTextParser

expfmt/text_parse_test.go:28–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestNewTextParser(t *testing.T) {
29 p := NewTextParser(model.UTF8Validation)
30 if p.scheme != model.UTF8Validation {
31 t.Errorf("expected NewTextParser to return a TextParser with scheme %s - got %s", model.UTF8Validation, p.scheme)
32 }
33
34 p = NewTextParser(model.LegacyValidation)
35 if p.scheme != model.LegacyValidation {
36 t.Errorf("expected NewTextParser to return a TextParser with scheme %s - got %s", model.LegacyValidation, p.scheme)
37 }
38
39 p = NewTextParser(model.UnsetValidation)
40 if p.scheme != model.UnsetValidation {
41 t.Errorf("expected NewTextParser to return a TextParser with scheme %s - got %s", model.UnsetValidation, p.scheme)
42 }
43}
44
45func testTextParse(t testing.TB) {
46 scenarios := []struct {

Callers

nothing calls this directly

Calls 1

NewTextParserFunction · 0.85

Tested by

no test coverage detected