...

Source file src/github.com/linkerd/linkerd2/viz/metrics-api/prometheus_test.go

Documentation: github.com/linkerd/linkerd2/viz/metrics-api

     1  package api
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/prometheus/common/model"
     7  )
     8  
     9  func TestGenerateLabelStringWithRegex(t *testing.T) {
    10  	query := generateLabelStringWithRegex(model.LabelSet{}, "key", "value")
    11  	if query != "{key=~\"^value.*\"}" {
    12  		t.Errorf("Expected 'key=~\"^value.+\"', got '%s'", query)
    13  	}
    14  }
    15  

View as plain text