|
|
@@ -0,0 +1,23 @@
|
|
|
+package float_test
|
|
|
+
|
|
|
+import (
|
|
|
+ "regexp"
|
|
|
+ "testing"
|
|
|
+
|
|
|
+ "github.com/stretchr/testify/assert"
|
|
|
+)
|
|
|
+
|
|
|
+func TestXXX(t *testing.T) {
|
|
|
+ var floatzero = regexp.MustCompile(`[\+\-]?0+(?:\.\0*)?(?:f|[Ee][\+\-]?\d+)?`)
|
|
|
+ if !assert.True(t,
|
|
|
+ floatzero.MatchString("0.0e1") &&
|
|
|
+ floatzero.MatchString("0.0") &&
|
|
|
+ floatzero.MatchString("0.0f") &&
|
|
|
+ floatzero.MatchString("00.00e00") &&
|
|
|
+ !floatzero.MatchString("") &&
|
|
|
+ !floatzero.MatchString("x") &&
|
|
|
+ floatzero.MatchString("0"),
|
|
|
+ ) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+}
|