github.com/TeaOSLab/EdgeNode@v1.3.8/internal/iplibrary/list_utils_test.go (about)

     1  // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
     2  
     3  package iplibrary
     4  
     5  import (
     6  	"github.com/TeaOSLab/EdgeNode/internal/utils/testutils"
     7  	"testing"
     8  	"time"
     9  )
    10  
    11  func TestIPIsAllowed(t *testing.T) {
    12  	if !testutils.IsSingleTesting() {
    13  		return
    14  	}
    15  
    16  	var manager = NewIPListManager()
    17  	manager.Init()
    18  
    19  	var before = time.Now()
    20  	defer func() {
    21  		t.Log(time.Since(before).Seconds()*1000, "ms")
    22  	}()
    23  	t.Log(AllowIP("127.0.0.1", 0))
    24  	t.Log(AllowIP("127.0.0.1", 23))
    25  }