float_test.go 485 B

1234567891011121314151617181920212223
  1. package float_test
  2. import (
  3. "regexp"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestXXX(t *testing.T) {
  8. var floatzero = regexp.MustCompile(`[\+\-]?0+(?:\.\0*)?(?:f|[Ee][\+\-]?\d+)?`)
  9. if !assert.True(t,
  10. floatzero.MatchString("0.0e1") &&
  11. floatzero.MatchString("0.0") &&
  12. floatzero.MatchString("0.0f") &&
  13. floatzero.MatchString("00.00e00") &&
  14. !floatzero.MatchString("") &&
  15. !floatzero.MatchString("x") &&
  16. floatzero.MatchString("0"),
  17. ) {
  18. return
  19. }
  20. }