mirror of
https://github.com/mpolden/echoip.git
synced 2025-06-29 14:17:50 +02:00
cmd: Remove go-flags
This commit is contained in:
@ -4,8 +4,24 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"testing"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
|
||||
c := NewCache(10)
|
||||
|
||||
for i := 0; i < 100; i++ {
|
||||
ip := net.ParseIP(fmt.Sprintf("192.0.2.%d", i))
|
||||
r := &Response{IP: ip}
|
||||
fmt.Println(unsafe.Sizeof(r))
|
||||
c.Set(ip, r)
|
||||
}
|
||||
|
||||
fmt.Println(len(c.entries))
|
||||
fmt.Println(len(c.keys))
|
||||
}
|
||||
|
||||
func TestCacheCapacity(t *testing.T) {
|
||||
var tests = []struct {
|
||||
addCount, capacity, size int
|
||||
|
Reference in New Issue
Block a user