-
Notifications
You must be signed in to change notification settings - Fork 0
/
match_test.go
76 lines (66 loc) · 1.07 KB
/
match_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package match
import (
"testing"
)
func Test_IsTime(t *testing.T) {
for _, time := range trueTime {
if IsTime(time) != true {
t.Errorf("%s is not a true time:", time)
}
}
for _, time := range falseTime {
if IsTime(time) != false {
t.Errorf("%s is not a false time", time)
}
}
}
//var tTime = []string{
// "09:45",
// "9:45",
// "23:59:59",
// "00:00:00",
// "12:12:12",
// "00:56:56",
// "12:13:12",
// "12:12:01",
// "23:45",
// "9:00am",
// "9:00 A.M.",
// "9:00 pm",
//}
//
//var fTime = []string{
// "19:45 pm",
// "19:45 am",
// "9:60",
// "pm23:45",
// "9:00:am",
// "9am",
// "19:00 A.M.",
// "9:00:pm",
//}
//
/*
func BenchmarkIsTime(b *testing.B) {
for n := 0; n < b.N; n++ {
for _, time := range trueTime {
IsTime(time)
}
for _, time := range falseTime {
IsTime(time)
}
}
}
func TestIsEmail(t *testing.T) {
for _, email := range trueEmails {
if IsEmail(email) != true {
t.Errorf("%s is not a email", email)
}
}
for _, email := range falseEmails {
if IsEmail(email) != false {
t.Errorf("%s is not a email", email)
}
}
}
*/