mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-29 03:30:24 +08:00
IP范围支持多行
This commit is contained in:
30
internal/waf/values/string_list_test.go
Normal file
30
internal/waf/values/string_list_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package values_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/values"
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseStringList(t *testing.T) {
|
||||
var a = assert.NewAssertion(t)
|
||||
|
||||
{
|
||||
var list = values.ParseStringList("")
|
||||
a.IsFalse(list.Contains("hello"))
|
||||
}
|
||||
|
||||
{
|
||||
var list = values.ParseStringList(`hello
|
||||
|
||||
world
|
||||
hi
|
||||
|
||||
people`)
|
||||
a.IsTrue(list.Contains("hello"))
|
||||
a.IsFalse(list.Contains("hello1"))
|
||||
a.IsTrue(list.Contains("hi"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user