MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TestParseQueue_ParsePtr

Function TestParseQueue_ParsePtr

internal/utils/agents/queue_test.go:47–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestParseQueue_ParsePtr(t *testing.T) {
48 var a = assert.NewAssertion(t)
49
50 var queue = agents.NewQueue()
51 for _, s := range [][]string{
52 {"baiduspider-220-181-108-101.crawl.baidu.com.", "baidu"},
53 {"crawl-66-249-71-219.googlebot.com.", "google"},
54 {"msnbot-40-77-167-31.search.msn.com.", "bing"},
55 {"sogouspider-49-7-20-129.crawl.sogou.com.", "sogou"},
56 {"m13102.mail.163.com.", "youdao"},
57 {"yeurosport.pat1.tc2.yahoo.com.", "yahoo"},
58 {"shenmaspider-42-120-160-1.crawl.sm.cn.", "sm"},
59 {"93-158-161-39.spider.yandex.com.", "yandex"},
60 {"25.bl.bot.semrush.com.", "semrush"},
61 } {
62 a.IsTrue(queue.ParsePtr(s[0]) == s[1])
63 }
64}
65
66func BenchmarkQueue_ParsePtr(b *testing.B) {
67 var queue = agents.NewQueue()

Callers

nothing calls this directly

Calls 2

NewQueueFunction · 0.92
ParsePtrMethod · 0.80

Tested by

no test coverage detected