forked from jamescun/legit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patterns_test.go
29 lines (22 loc) · 882 Bytes
/
patterns_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
package legit
import (
"testing"
)
func TestEmail(t *testing.T) {
testString(t, Email("foo@example.org"), Email("foo@@bar@!"), errEmail)
}
func TestCreditCard(t *testing.T) {
testString(t, CreditCard("375556917985515"), CreditCard("foo"), errCreditCard)
}
func TestUUID(t *testing.T) {
testString(t, UUID("a987fbc9-4bed-3078-cf07-9141ba07c9f3"), UUID("xxxa987fbc9-4bed-3078-cf07-9141ba07c9f3"), errUUID)
}
func TestUUID3(t *testing.T) {
testString(t, UUID3("a987fbc9-4bed-3078-cf07-9141ba07c9f3"), UUID3("xxxa987fbc9-4bed-3078-cf07-9141ba07c9f3"), errUUID3)
}
func TestUUID4(t *testing.T) {
testString(t, UUID4("625e63f3-58f5-40b7-83a1-a72ad31acffb"), UUID4("xxxa987fbc9-4bed-3078-cf07-9141ba07c9f3"), errUUID4)
}
func TestUUID5(t *testing.T) {
testString(t, UUID5("987fbc97-4bed-5078-9f07-9141ba07c9f3"), UUID5("xxxa987fbc9-4bed-3078-cf07-9141ba07c9f3"), errUUID5)
}