Unit tests for token and update models

This commit is contained in:
Ethan Koenig 2016-12-28 20:03:40 -05:00 committed by Kim "BKC" Carlbäcker
parent c0904f1942
commit de8b73dd92
41 changed files with 11919 additions and 0 deletions

36
vendor/gopkg.in/testfixtures.v2/time.go generated vendored Normal file
View file

@ -0,0 +1,36 @@
package testfixtures
import "regexp"
var (
regexpDate = regexp.MustCompile("\\d\\d\\d\\d-\\d\\d-\\d\\d")
regexpDateTime = regexp.MustCompile("\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d")
regexpTime = regexp.MustCompile("\\d\\d:\\d\\d:\\d\\d")
)
func isDate(value interface{}) bool {
str, isStr := value.(string)
if !isStr {
return false
}
return regexpDate.MatchString(str)
}
func isDateTime(value interface{}) bool {
str, isStr := value.(string)
if !isStr {
return false
}
return regexpDateTime.MatchString(str)
}
func isTime(value interface{}) bool {
str, isStr := value.(string)
if !isStr {
return false
}
return regexpTime.MatchString(str)
}