chore: add more tests (#2866)

* chore: add more tests

* chore: add more tests

* chore: fix test failure
This commit is contained in:
Kevin Wan
2023-02-11 14:21:39 +08:00
committed by kevin
parent 89f841c126
commit 04f181f0b4
6 changed files with 48 additions and 6 deletions

View File

@@ -6,6 +6,15 @@ import (
"github.com/stretchr/testify/assert"
)
func TestLongestMatchGuardedCondition(t *testing.T) {
n := new(node)
n.end = true
used, jump, matched := n.longestMatch([]rune(""), 0)
assert.Equal(t, 0, used)
assert.Nil(t, jump)
assert.True(t, matched)
}
func TestFuzzNodeCase1(t *testing.T) {
keywords := []string{
"cs8Zh",