Skip to content

Commit

Permalink
fix: tests to correctly reflect all 64bit numbers sent as strings for…
Browse files Browse the repository at this point in the history
… broker
  • Loading branch information
maier committed Dec 5, 2023
1 parent 06cef05 commit 4cb3449
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestTrapMetrics_CounterIncrement(t *testing.T) {
Value: "bar",
},
},
wantJSON: `"_value":1`,
wantJSON: `"_value":"1"`,
wantErr: false,
},
}
Expand Down
9 changes: 5 additions & 4 deletions gauge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package trapmetrics

import (
"fmt"
"strings"
"testing"
"time"
Expand All @@ -30,7 +31,7 @@ func TestTrapMetrics_GaugeSet(t *testing.T) {
Value: "bar",
},
},
wantJSON: `"_value":1`,
wantJSON: `"_value":"1"`,
wantErr: false,
},
}
Expand Down Expand Up @@ -107,7 +108,7 @@ func TestTrapMetrics_GaugeAdd(t *testing.T) {
Value: "bar",
},
},
wantJSON: `"_value":2`,
wantJSON: `"_value":"2"`,
wantValue: int64(2),
wantErr: false,
},
Expand Down Expand Up @@ -135,7 +136,7 @@ func TestTrapMetrics_GaugeAdd(t *testing.T) {
Value: "bar",
},
},
wantJSON: `"_value":2`,
wantJSON: `"_value":"2"`,
wantValue: uint64(2),
wantErr: false,
},
Expand All @@ -149,7 +150,7 @@ func TestTrapMetrics_GaugeAdd(t *testing.T) {
Value: "bar",
},
},
wantJSON: `"_value":2.4`,
wantJSON: fmt.Sprintf(`"_value":"%f"`, float64(2.4)),
wantValue: float64(2.4),
wantErr: false,
},
Expand Down

0 comments on commit 4cb3449

Please sign in to comment.