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

Commit 3f88050

Browse files
committed
test: refactoring benchmark
Signed-off-by: Alexander Bezzubov <[email protected]>
1 parent 5c5255c commit 3f88050

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

driver/normalizer/strconv_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ func printDebug(t *testing.T, quoted, actual string) {
7272

7373
func BenchmarkReplacingNullEscape_Iterative(b *testing.B) {
7474
b.ReportAllocs()
75-
for n := 0; n < b.N; n++ {
76-
for _, test := range testCasesUnquote {
75+
for _, test := range testCasesUnquote {
76+
for n := 0; n < b.N; n++ {
7777
replaceEscapedMaybeIter(test.quoted, '0', '\x00')
7878
}
7979
}
@@ -118,8 +118,8 @@ func replaceEscapedMaybeIter(s string, old, new rune) string {
118118

119119
func BenchmarkReplacingNullEscape_Regexp(b *testing.B) {
120120
b.ReportAllocs()
121-
for n := 0; n < b.N; n++ {
122-
for _, test := range testCasesUnquote {
121+
for _, test := range testCasesUnquote {
122+
for n := 0; n < b.N; n++ {
123123
replaceEscapedMaybeRegexp(test.quoted)
124124
}
125125
}
@@ -135,8 +135,8 @@ func replaceEscapedMaybeRegexp(s string) string {
135135

136136
func BenchmarkReplacingNullEscape_Simple(b *testing.B) {
137137
b.ReportAllocs()
138-
for n := 0; n < b.N; n++ {
139-
for _, test := range testCasesUnquote {
138+
for _, test := range testCasesUnquote {
139+
for n := 0; n < b.N; n++ {
140140
replaceEscapedMaybe(test.quoted, "\\0", "\x00")
141141
}
142142
}

0 commit comments

Comments
 (0)