1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-27 15:40:27 +08:00

TUN-528: Move cloudflared into a separate repo

This commit is contained in:
Areg Harutyunyan
2018-05-01 18:45:06 -05:00
parent e8c621a648
commit d06fc520c7
4726 changed files with 1763680 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package trie
import (
//"fmt"
"testing"
)
func Test(t *testing.T) {
x := New()
x.Insert(1, 100)
if x.Len() != 1 {
t.Errorf("expected len 1")
}
if x.Get(1).(int) != 100 {
t.Errorf("expected to get 100 for 1")
}
x.Remove(1)
if x.Len() != 0 {
t.Errorf("expected len 0")
}
x.Insert(2, 200)
x.Insert(1, 100)
vs := make([]int, 0)
x.Do(func(k, v interface{}) bool {
vs = append(vs, k.(int))
return true
})
if len(vs) != 2 || vs[0] != 1 || vs[1] != 2 {
t.Errorf("expected in order traversal")
}
}