Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit e7a074f

Browse files
committed
test: refactor benchmark, breaking down by testcase
Signed-off-by: Alexander Bezzubov <[email protected]>
1 parent 7f92d74 commit e7a074f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: driver/normalizer/strconv_test.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ func printDebug(t *testing.T, quoted, actual string) {
6666
}
6767

6868
func BenchmarkReplacingNullEscape(b *testing.B) {
69-
b.ReportAllocs()
7069
for _, test := range testCasesUnquote {
71-
for n := 0; n < b.N; n++ {
72-
replaceEscapedMaybe(test.quoted, "\\0", "\x00")
73-
}
70+
b.Run("", func(b *testing.B) {
71+
b.ReportAllocs()
72+
for n := 0; n < b.N; n++ {
73+
replaceEscapedMaybe(test.quoted, "\\0", "\x00")
74+
}
75+
})
7476
}
7577
}

0 commit comments

Comments
 (0)