mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 22:24:31 +08:00
Fixing bug in url query reader and added test cases
This commit is contained in:
22
pkg/util/validation_test.go
Normal file
22
pkg/util/validation_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
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)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user