mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-07 00:05:49 +08:00
阶段性提交
This commit is contained in:
17
internal/configs/serverconfigs/shared/regexp_test.go
Normal file
17
internal/configs/serverconfigs/shared/regexp_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package shared
|
||||
|
||||
import (
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRegexp(t *testing.T) {
|
||||
a := assert.NewAssertion(t)
|
||||
|
||||
a.IsTrue(RegexpFloatNumber.MatchString("123"))
|
||||
a.IsTrue(RegexpFloatNumber.MatchString("123.456"))
|
||||
a.IsFalse(RegexpFloatNumber.MatchString(".456"))
|
||||
a.IsFalse(RegexpFloatNumber.MatchString("abc"))
|
||||
a.IsFalse(RegexpFloatNumber.MatchString("123."))
|
||||
a.IsFalse(RegexpFloatNumber.MatchString("123.456e7"))
|
||||
}
|
||||
Reference in New Issue
Block a user