(t *testing.T)
| 7 | } |
| 8 | |
| 9 | func Test_binaryTree(t *testing.T) { |
| 10 | tree := New(compare) |
| 11 | |
| 12 | tree.Insert(1) |
| 13 | tree.Insert(2) |
| 14 | tree.Insert(3) |
| 15 | |
| 16 | findTree := tree.Search(2) |
| 17 | if findTree.node != 2 { |
| 18 | t.Error("[Error] Search error") |
| 19 | } |
| 20 | |
| 21 | findNilTree := tree.Search(100) |
| 22 | |
| 23 | if findNilTree != nil { |
| 24 | t.Error("[Error] 2. Search error") |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func Test_minmax(t *testing.T) { |
| 29 | tree := New(compare) |