Files
EdgeAPI/internal/utils/regexputils/expr_test.go

21 lines
536 B
Go
Raw Normal View History

2024-07-27 14:15:25 +08:00
// Copyright 2022 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
2022-10-14 10:03:29 +08:00
package regexputils_test
import (
2024-07-27 14:15:25 +08:00
"testing"
2022-10-14 10:03:29 +08:00
"github.com/TeaOSLab/EdgeAPI/internal/utils/regexputils"
"github.com/iwind/TeaGo/assert"
)
func TestExpr(t *testing.T) {
var a = assert.NewAssertion(t)
a.IsTrue(regexputils.YYYYMMDD.MatchString("20221011"))
a.IsFalse(regexputils.YYYYMMDD.MatchString("202210"))
a.IsTrue(regexputils.YYYYMM.MatchString("202210"))
a.IsFalse(regexputils.YYYYMM.MatchString("20221011"))
}