chore[test]: make sure database is empty when doing slice tests

This commit is contained in:
Melbex De Leon 2022-05-31 09:16:41 +08:00
parent 66d58c3117
commit 266d7a4c0f
No known key found for this signature in database
GPG Key ID: 9A664266F44E5B74

View File

@ -37,6 +37,7 @@ func BenchmarkScan(b *testing.B) {
}
func BenchmarkScanSlice(b *testing.B) {
DB.Exec("delete * from users")
for i := 0; i < 10_000; i++ {
user := *GetUser(fmt.Sprintf("scan-%d", i), Config{})
DB.Create(&user)
@ -50,6 +51,7 @@ func BenchmarkScanSlice(b *testing.B) {
}
func BenchmarkScanSlicePointer(b *testing.B) {
DB.Exec("delete * from users")
for i := 0; i < 10_000; i++ {
user := *GetUser(fmt.Sprintf("scan-%d", i), Config{})
DB.Create(&user)