优化代码

This commit is contained in:
GoEdgeLab
2022-01-01 22:02:46 +08:00
parent e67b56f685
commit a9af7421d3
2 changed files with 6 additions and 4 deletions

View File

@@ -12,8 +12,10 @@ import (
func TestUserAgentParser_Parse(t *testing.T) {
var parser = NewUserAgentParser()
t.Log(parser.Parse("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Test/1"))
t.Log(parser.Parse("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"))
for i := 0; i < 4; i ++ {
t.Log(parser.Parse("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Test/1"))
t.Log(parser.Parse("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"))
}
}
func TestUserAgentParser_Parse_Unknown(t *testing.T) {