Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sado0823 committed Oct 13, 2023
1 parent 3985549 commit fd5b96e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kit/trie/trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,19 @@ func Test_Trie(t *testing.T) {
func Test_WithMask(t *testing.T) {
trieTree := New([]string{
"美国",
}, WithMask(rune('$')))
}, WithMask('$'))

input := "美国队长"
output := "$$队长"
keywords := []string{"美国"}
hit := true

maskText, keywords2, hit2 := trieTree.Filter(input)
fmt.Println("maskText:---", maskText)
fmt.Println("keywords2:---", keywords2)
fmt.Println("hit2:---", hit2)
assert.Equal(t, output, maskText)
assert.ElementsMatch(t, keywords, keywords2)
assert.Equal(t, hit, hit2)
assert.Equal(t, true, hit2)

}

Expand Down Expand Up @@ -151,4 +150,4 @@ func BenchmarkTrie(b *testing.B) {
fmt.Println("hit:---", hit)
})
}
}
}

0 comments on commit fd5b96e

Please sign in to comment.