mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 01:20:25 +08:00
24 lines
876 B
Go
24 lines
876 B
Go
|
|
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||
|
|
|
||
|
|
package services
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/iwind/TeaGo/assert"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestHTTPCacheTaskService_CountHTTPCacheTasks(t *testing.T) {
|
||
|
|
var a = assert.NewAssertion(t)
|
||
|
|
|
||
|
|
var service = &HTTPCacheTaskService{}
|
||
|
|
a.IsTrue(service.parseDomain("aaa") == "aaa")
|
||
|
|
a.IsTrue(service.parseDomain("AAA") == "aaa")
|
||
|
|
a.IsTrue(service.parseDomain("a.b-c.com") == "a.b-c.com")
|
||
|
|
a.IsTrue(service.parseDomain("a.b-c.com/hello/world") == "a.b-c.com")
|
||
|
|
a.IsTrue(service.parseDomain("https://a.b-c.com") == "a.b-c.com")
|
||
|
|
a.IsTrue(service.parseDomain("http://a.b-c.com/hello/world") == "a.b-c.com")
|
||
|
|
a.IsTrue(service.parseDomain("http://a.B-c.com/hello/world") == "a.b-c.com")
|
||
|
|
a.IsTrue(service.parseDomain("http:/aaaa.com") == "http")
|
||
|
|
a.IsTrue(service.parseDomain("北京") == "")
|
||
|
|
}
|