Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tests to correctly reflect all 64bit numbers sent as strings for… #33

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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