(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func Test_minmax(t *testing.T) { |
| 29 | tree := New(compare) |
| 30 | |
| 31 | testValues := []int{4, 5, 3, 2, 9} |
| 32 | for _, i := range testValues { |
| 33 | tree.Insert(i) |
| 34 | } |
| 35 | |
| 36 | max := tree.Max() |
| 37 | if max != 9 { |
| 38 | t.Errorf("[Error] max: expected 9, got %d", max) |
| 39 | } |
| 40 | |
| 41 | min := tree.Min() |
| 42 | if min != 2 { |
| 43 | t.Errorf("[Error] max: expected 2, got %d", min) |
| 44 | } |
| 45 | } |