MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestNewRuneTree

Function TestNewRuneTree

internal/re/rune_tree_test.go:12–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestNewRuneTree(t *testing.T) {
13 var a = assert.NewAssertion(t)
14
15 var tree = re.NewRuneTree([]string{"abc", "abd", "def", "GHI", "中国", "@"})
16 a.IsTrue(tree.Lookup("ABC", true))
17 a.IsTrue(tree.Lookup("ABC1", true))
18 a.IsTrue(tree.Lookup("1ABC", true))
19 a.IsTrue(tree.Lookup("def", true))
20 a.IsTrue(tree.Lookup("ghI", true))
21 a.IsFalse(tree.Lookup("d ef", true))
22 a.IsFalse(tree.Lookup("de", true))
23 a.IsFalse(tree.Lookup("de f", true))
24 a.IsTrue(tree.Lookup("我是中国人", true))
25 a.IsTrue(tree.Lookup("iwind.liu@gmail.com", true))
26}
27
28func TestNewRuneTree2(t *testing.T) {
29 var tree = re.NewRuneTree([]string{"abc", "abd", "def", "GHI", "中国", "@"})

Callers

nothing calls this directly

Calls 2

NewRuneTreeFunction · 0.92
LookupMethod · 0.80

Tested by

no test coverage detected