mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 03:32:33 +08:00
chore: add test case
This commit is contained in:
parent
f54bf2d935
commit
d4e48d709f
|
@ -43,6 +43,7 @@ func TestDomainWildcard(t *testing.T) {
|
||||||
domainSet := []string{
|
domainSet := []string{
|
||||||
"*.*.*.baidu.com",
|
"*.*.*.baidu.com",
|
||||||
"www.baidu.*",
|
"www.baidu.*",
|
||||||
|
"stun.*.*",
|
||||||
"*.*.qq.com",
|
"*.*.qq.com",
|
||||||
"test.*.baidu.com",
|
"test.*.baidu.com",
|
||||||
}
|
}
|
||||||
|
@ -51,7 +52,9 @@ func TestDomainWildcard(t *testing.T) {
|
||||||
assert.True(t, set.Has("www.baidu.com"))
|
assert.True(t, set.Has("www.baidu.com"))
|
||||||
assert.True(t, set.Has("test.test.baidu.com"))
|
assert.True(t, set.Has("test.test.baidu.com"))
|
||||||
assert.True(t, set.Has("test.test.qq.com"))
|
assert.True(t, set.Has("test.test.qq.com"))
|
||||||
|
assert.True(t,set.Has("stun.ab.cd"))
|
||||||
assert.False(t, set.Has("test.baidu.com"))
|
assert.False(t, set.Has("test.baidu.com"))
|
||||||
|
assert.False(t,set.Has("www.google.com"))
|
||||||
assert.False(t, set.Has("test.qq.com"))
|
assert.False(t, set.Has("test.qq.com"))
|
||||||
assert.False(t, set.Has("test.test.test.qq.com"))
|
assert.False(t, set.Has("test.test.test.qq.com"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user