Skip to content

Commit

Permalink
add test cut url code
Browse files Browse the repository at this point in the history
  • Loading branch information
vcaesar committed Jan 16, 2021
1 parent 0446abb commit 2cbb011
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,10 @@ func TestNum(t *testing.T) {
s = seg.CutSearch(text)
tt.Equal(t, "[t 1 2 3 test 1 2 3 num 1 2 3 - 1]", s)
}

func TestUrl(t *testing.T) {
seg := New("./testdata/test_dict3.txt")

s1 := seg.CutUrls("https://www.g.com/search?q=test%m11.42&ie=UTF-8")
tt.Equal(t, "https www g com search q test m 11 42 ie utf 8", s1)
}

0 comments on commit 2cbb011

Please sign in to comment.