Skip to content

Commit d278589

Browse files
committed
spellcheck
1 parent 751a3ff commit d278589

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

cspell.config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"testid",
3030
"tokenprovider",
3131
"typecheck",
32-
"uplot"
32+
"uplot",
33+
"bestmemjson",
34+
"jsoniter"
3335
],
3436
"language": "en-US"
3537
}

pkg/bestmemjson/bestmemjson_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestBestMemJSONEfficiency(t *testing.T) {
4848
}
4949
})
5050

51-
bestmemResult := testing.Benchmark(func(b *testing.B) {
51+
bestMemResult := testing.Benchmark(func(b *testing.B) {
5252
b.ResetTimer()
5353
b.ReportAllocs()
5454
for i := 0; i < b.N; i++ {
@@ -65,18 +65,18 @@ func TestBestMemJSONEfficiency(t *testing.T) {
6565
standardResult.AllocsPerOp(),
6666
jsoniterResult.AllocedBytesPerOp(),
6767
jsoniterResult.AllocsPerOp(),
68-
bestmemResult.AllocedBytesPerOp(),
69-
bestmemResult.AllocsPerOp())
68+
bestMemResult.AllocedBytesPerOp(),
69+
bestMemResult.AllocsPerOp())
7070

7171
// Verify bestmemjson is using the most memory-efficient implementation
72-
assert.LessOrEqual(t, bestmemResult.AllocedBytesPerOp(), standardResult.AllocedBytesPerOp(),
72+
assert.LessOrEqual(t, bestMemResult.AllocedBytesPerOp(), standardResult.AllocedBytesPerOp(),
7373
"bestmemjson.Marshal should not use more memory than encoding/json.Marshal")
74-
assert.LessOrEqual(t, bestmemResult.AllocedBytesPerOp(), jsoniterResult.AllocedBytesPerOp(),
74+
assert.LessOrEqual(t, bestMemResult.AllocedBytesPerOp(), jsoniterResult.AllocedBytesPerOp(),
7575
"bestmemjson.Marshal should not use more memory than jsoniter.Marshal")
7676
})
7777

7878
t.Run("Unmarshal memory efficiency", func(t *testing.T) {
79-
var standardModel, jsoniterModel, bestmemModel testStruct
79+
var standardModel, jsoniterModel, bestMemModel testStruct
8080

8181
standardResult := testing.Benchmark(func(b *testing.B) {
8282
b.ResetTimer()
@@ -94,11 +94,11 @@ func TestBestMemJSONEfficiency(t *testing.T) {
9494
}
9595
})
9696

97-
bestmemResult := testing.Benchmark(func(b *testing.B) {
97+
bestMemResult := testing.Benchmark(func(b *testing.B) {
9898
b.ResetTimer()
9999
b.ReportAllocs()
100100
for i := 0; i < b.N; i++ {
101-
_ = Unmarshal(testJSON, &bestmemModel)
101+
_ = Unmarshal(testJSON, &bestMemModel)
102102
}
103103
})
104104

@@ -111,17 +111,17 @@ func TestBestMemJSONEfficiency(t *testing.T) {
111111
standardResult.AllocsPerOp(),
112112
jsoniterResult.AllocedBytesPerOp(),
113113
jsoniterResult.AllocsPerOp(),
114-
bestmemResult.AllocedBytesPerOp(),
115-
bestmemResult.AllocsPerOp())
114+
bestMemResult.AllocedBytesPerOp(),
115+
bestMemResult.AllocsPerOp())
116116

117117
// Verify bestmemjson is using the most memory-efficient implementation
118-
assert.LessOrEqual(t, bestmemResult.AllocedBytesPerOp(), standardResult.AllocedBytesPerOp(),
118+
assert.LessOrEqual(t, bestMemResult.AllocedBytesPerOp(), standardResult.AllocedBytesPerOp(),
119119
"bestmemjson.Unmarshal should not use more memory than encoding/json.Unmarshal")
120-
assert.LessOrEqual(t, bestmemResult.AllocedBytesPerOp(), jsoniterResult.AllocedBytesPerOp(),
120+
assert.LessOrEqual(t, bestMemResult.AllocedBytesPerOp(), jsoniterResult.AllocedBytesPerOp(),
121121
"bestmemjson.Unmarshal should not use more memory than jsoniter.Unmarshal")
122122

123123
// Verify all implementations produce the same result
124-
assert.Equal(t, standardModel, bestmemModel, "bestmemjson.Unmarshal should produce same result as encoding/json")
125-
assert.Equal(t, jsoniterModel, bestmemModel, "bestmemjson.Unmarshal should produce same result as jsoniter")
124+
assert.Equal(t, standardModel, bestMemModel, "bestmemjson.Unmarshal should produce same result as encoding/json")
125+
assert.Equal(t, jsoniterModel, bestMemModel, "bestmemjson.Unmarshal should produce same result as jsoniter")
126126
})
127127
}

0 commit comments

Comments
 (0)