grafana/pkg/util/validation_test.go
Arve Knudsen 41d432b5ae
Chore: Enable whitespace linter (#25903)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00

22 lines
408 B
Go

package util
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestIsEmail(t *testing.T) {
Convey("When validating a string that is a valid email", t, func() {
result := IsEmail("abc@def.com")
So(result, ShouldEqual, true)
})
Convey("When validating a string that is not a valid email", t, func() {
result := IsEmail("abcdef.com")
So(result, ShouldEqual, false)
})
}