Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting committed Jun 3, 2024
1 parent 1ee44ff commit 7e7eb1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/emetric/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestCounterVec(t *testing.T) {
name := "test"
labels := []string{"hello", "world"}
label := []string{"hello", "world"}

mockCounterVec := &prometheus.CounterVec{}
vec := func(opts prometheus.GaugeOpts, labels []string) *prometheus.CounterVec {

Check failure on line 16 in core/emetric/counter_test.go

View workflow job for this annotation

GitHub Actions / lint

SA4009: argument labels is overwritten before first use (staticcheck)
Expand All @@ -27,6 +27,6 @@ func TestCounterVec(t *testing.T) {
assert.Equal(t, name, opts.Help)
return mockCounterVec
}
out := NewCounterVec(name, labels)
out := NewCounterVec(name, label)
reflect.DeepEqual(vec, out.CounterVec)
}
4 changes: 2 additions & 2 deletions core/emetric/gauge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestNewGaugeVec(t *testing.T) {
name := "test_"
labels := []string{"hello_", "world_"}
label := []string{"hello_", "world_"}

mockGaugeVec := &prometheus.GaugeVec{}
vec := func(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec {

Check failure on line 16 in core/emetric/gauge_test.go

View workflow job for this annotation

GitHub Actions / lint

SA4009: argument labels is overwritten before first use (staticcheck)
Expand All @@ -27,6 +27,6 @@ func TestNewGaugeVec(t *testing.T) {
assert.Equal(t, name, opts.Help)
return mockGaugeVec
}
out := NewGaugeVec(name, labels)
out := NewGaugeVec(name, label)
reflect.DeepEqual(vec, out.GaugeVec)
}

0 comments on commit 7e7eb1c

Please sign in to comment.