Skip to content

Commit

Permalink
Update promql_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxin688 authored Feb 4, 2025
1 parent eb3411d commit 6b95e11
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions promql_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gopromql
package vtm

import (
"fmt"
Expand All @@ -9,21 +9,21 @@ import (
func TestBuild(t *testing.T) {
tests := []struct {
name string
pb *PromqlBuilder
pb *PromQLBuilder
expected string
err error
}{
{
name: "basic case",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
},
expected: "metric",
err: nil,
},
{
name: "with labels",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
labels: []Label{
{
Expand All @@ -43,7 +43,7 @@ func TestBuild(t *testing.T) {
},
{
name: "with window",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
window: "5m",
},
Expand All @@ -52,7 +52,7 @@ func TestBuild(t *testing.T) {
},
{
name: "with compare",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
compOps: []Compare{
{
Expand All @@ -70,7 +70,7 @@ func TestBuild(t *testing.T) {
},
{
name: "with function",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
funcName: "sum",
},
Expand All @@ -79,7 +79,7 @@ func TestBuild(t *testing.T) {
},
{
name: "with offset",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
offset: "5m",
},
Expand All @@ -88,7 +88,7 @@ func TestBuild(t *testing.T) {
},
{
name: "with aggregation",
pb: &PromqlBuilder{
pb: &PromQLBuilder{
metricName: "metric",
agg: Aggregation{
Op: "sum",
Expand All @@ -101,7 +101,7 @@ func TestBuild(t *testing.T) {
},
{
name: "with missing metric name",
pb: &PromqlBuilder{},
pb: &PromQLBuilder{},
err: fmt.Errorf("metric name is required"),
},
}
Expand Down

0 comments on commit 6b95e11

Please sign in to comment.