From dc60b4c9a2ce5b699ad07676e94d69f7be0e6384 Mon Sep 17 00:00:00 2001 From: kenshinx Date: Thu, 1 Feb 2018 18:39:40 +0800 Subject: [PATCH] Supplement test case, www.google.com should match /google.com/ --- sfx_tree_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sfx_tree_test.go b/sfx_tree_test.go index 47471dd..b2f0ae1 100644 --- a/sfx_tree_test.go +++ b/sfx_tree_test.go @@ -33,6 +33,10 @@ func Test_Suffix_Tree(t *testing.T) { So(found, ShouldEqual, true) So(v, ShouldEqual, "8.8.8.8") + v, found = root.search(strings.Split("www.google.com", ".")) + So(found, ShouldEqual, true) + So(v, ShouldEqual, "8.8.8.8") + v, found = root.search(strings.Split("scholar.google.com", ".")) So(found, ShouldEqual, true) So(v, ShouldEqual, "208.67.222.222")