chore: add more tests (#3338)
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
type mockedRoute struct {
|
||||
route string
|
||||
value int
|
||||
value any
|
||||
}
|
||||
|
||||
func TestSearch(t *testing.T) {
|
||||
@@ -187,6 +187,12 @@ func TestSearchInvalidItem(t *testing.T) {
|
||||
assert.Equal(t, errEmptyItem, err)
|
||||
}
|
||||
|
||||
func TestSearchInvalidState(t *testing.T) {
|
||||
nd := newNode("0")
|
||||
nd.children[0]["1"] = nil
|
||||
assert.Error(t, add(nd, "1/2", "2"))
|
||||
}
|
||||
|
||||
func BenchmarkSearchTree(b *testing.B) {
|
||||
const (
|
||||
avgLen = 1000
|
||||
|
||||
Reference in New Issue
Block a user