mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-08 11:20:26 +08:00
增加刷新、预热缓存任务管理
This commit is contained in:
23
internal/rpc/services/service_http_cache_task_test.go
Normal file
23
internal/rpc/services/service_http_cache_task_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// 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("北京") == "")
|
||||
}
|
||||
Reference in New Issue
Block a user