Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
package splay |
| 2 |
|
| 3 |
import ( |
| 4 |
//"fmt" |
| 5 |
"testing" |
| 6 |
) |
| 7 |
|
| 8 |
func Test(t *testing.T) { |
| 9 |
tree := New(func(a,b interface{})bool { |
| 10 |
return a.(string) < b.(string) |
| 11 |
}) |
| 12 |
|
| 13 |
tree.Insert("d", 4) |
| 14 |
tree.Insert("b", 2) |
| 15 |
tree.Insert("a", 1) |
| 16 |
tree.Insert("c", 3) |
| 17 |
|
| 18 |
if tree.Len() != 4 { |
| 19 |
t.Errorf("expecting len 4") |
| 20 |
} |
| 21 |
|
| 22 |
tree.Remove("b") |
| 23 |
|
| 24 |
if tree.Len() != 3 { |
| 25 |
t.Errorf("expecting len 3") |
| 26 |
} |
| 27 |
} |