Skip to content

Commit 0b7f991

Browse files
committed
update benchmark code
1 parent 69616aa commit 0b7f991

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

builder/builder_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func Test_BuildSelect(t *testing.T) {
329329

330330
func BenchmarkBuildSelect_Sequelization(b *testing.B) {
331331
for i := 0; i < b.N; i++ {
332-
BuildSelect("tb", map[string]interface{}{
332+
_,_,err := BuildSelect("tb", map[string]interface{}{
333333
"foo": "bar",
334334
"qq": "tt",
335335
"age in": []interface{}{1, 3, 5, 7, 9},
@@ -338,6 +338,9 @@ func BenchmarkBuildSelect_Sequelization(b *testing.B) {
338338
"_groupby": "department",
339339
"_limit": []uint{0, 100},
340340
}, []string{"a", "b", "c"})
341+
if err != nil {
342+
b.FailNow()
343+
}
341344
}
342345
}
343346

@@ -355,7 +358,7 @@ func BenchmarkBuildSelect_Parallel(b *testing.B) {
355358
"_limit": []uint{0, 100},
356359
}, nil)
357360
if cond != expectCond {
358-
b.Errorf("should be %s but %s\n", expectCond, cond)
361+
b.Fatalf("should be %s but %s\n", expectCond, cond)
359362
}
360363
}
361364
})

0 commit comments

Comments
 (0)