mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 17:40:24 +08:00
26 lines
434 B
Go
26 lines
434 B
Go
|
|
package models
|
||
|
|
|
||
|
|
import (
|
||
|
|
_ "github.com/go-sql-driver/mysql"
|
||
|
|
"runtime"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestIPListDAO_IncreaseVersion(t *testing.T) {
|
||
|
|
dao := NewIPListDAO()
|
||
|
|
version, err := dao.IncreaseVersion(1)
|
||
|
|
if err != nil {
|
||
|
|
t.Fatal(err)
|
||
|
|
}
|
||
|
|
t.Log("version:", version)
|
||
|
|
}
|
||
|
|
|
||
|
|
func BenchmarkIPListDAO_IncreaseVersion(b *testing.B) {
|
||
|
|
runtime.GOMAXPROCS(1)
|
||
|
|
|
||
|
|
dao := NewIPListDAO()
|
||
|
|
for i := 0; i < b.N; i++ {
|
||
|
|
_, _ = dao.IncreaseVersion(1)
|
||
|
|
}
|
||
|
|
}
|