validation_test.go 409 B

12345678910111213141516171819202122
  1. package util
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestIsEmail(t *testing.T) {
  7. Convey("When validating a string that is a valid email", t, func() {
  8. result := IsEmail("abc@def.com")
  9. So(result, ShouldEqual, true)
  10. })
  11. Convey("When validating a string that is not a valid email", t, func() {
  12. result := IsEmail("abcdef.com")
  13. So(result, ShouldEqual, false)
  14. })
  15. }