Files
EdgeAPI/internal/db/models/ip_list_dao_test.go

31 lines
502 B
Go

package models
import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
"runtime"
"testing"
)
func TestIPListDAO_IncreaseVersion(t *testing.T) {
dbs.NotifyReady()
dao := NewIPListDAO()
version, err := dao.IncreaseVersion()
if err != nil {
t.Fatal(err)
}
t.Log("version:", version)
}
func BenchmarkIPListDAO_IncreaseVersion(b *testing.B) {
runtime.GOMAXPROCS(1)
dbs.NotifyReady()
dao := NewIPListDAO()
for i := 0; i < b.N; i++ {
_, _ = dao.IncreaseVersion()
}
}