Debian Codegraph @

splay/splay_test.go

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 //+build skip_this_test
2
3 package splay
4
5 import (
6 //"fmt"
7 "testing"
8 )
9
10 func Test(t *testing.T) {
•11 tree := New(func(a, b interface{}) bool {
12 return a.(string) < b.(string)
13 })
•14
15 tree.Insert("d", 4)
16 tree.Insert("b", 2)
17 tree.Insert("a", 1)
18 tree.Insert("c", 3)
•19
20 if tree.Len() != 4 {
21 t.Errorf("expecting len 4")
22 }
23
•24 tree.Remove("b")
25
26 if tree.Len() != 3 {
27 t.Errorf("expecting len 3")
28 }
•29 }