mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-05 06:10:25 +08:00
18 lines
440 B
Go
18 lines
440 B
Go
|
|
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"))
|
||
|
|
}
|