mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 23:20:26 +08:00
31 lines
502 B
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()
|
|
}
|
|
}
|