mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-05 00:34:01 +08:00
27 lines
475 B
Go
27 lines
475 B
Go
// Copyright 2021 GoEdge goedge.cdn@gmail.com. All rights reserved.
|
|
|
|
package iplibrary
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/TeaOSLab/EdgeNode/internal/utils/testutils"
|
|
)
|
|
|
|
func TestIPIsAllowed(t *testing.T) {
|
|
if !testutils.IsSingleTesting() {
|
|
return
|
|
}
|
|
|
|
var manager = NewIPListManager()
|
|
manager.Init()
|
|
|
|
var before = time.Now()
|
|
defer func() {
|
|
t.Log(time.Since(before).Seconds()*1000, "ms")
|
|
}()
|
|
t.Log(AllowIP("127.0.0.1", 0))
|
|
t.Log(AllowIP("127.0.0.1", 23))
|
|
}
|