MCPcopy Index your code
hub / github.com/0xAX/go-algorithms / Test_binaryTree

Function Test_binaryTree

binaryTree/binaryTree_test.go:9–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7}
8
9func 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
28func Test_minmax(t *testing.T) {
29 tree := New(compare)

Callers

nothing calls this directly

Calls 3

InsertMethod · 0.80
SearchMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected