-
Notifications
You must be signed in to change notification settings - Fork 6
/
mobilephone_docomo_test.go
132 lines (129 loc) · 6.56 KB
/
mobilephone_docomo_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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* This file is auto-generated! Any changes to this file will be lost! */
package woothee
import (
"testing"
)
func Test_mobilephone_docomo(t *testing.T) {
var result *Result
var err error
result, err = Parse(`DoCoMo/2.0 SH01A(c100;TB;W24H16)`)
if err != nil {
t.Errorf(`Failed to parse 'DoCoMo/2.0 SH01A(c100;TB;W24H16)': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `DoCoMo/2.0 SH01A(c100;TB;W24H16)`, result.Category)
}
if result.Name != "docomo" {
t.Errorf("Expected result.Name for '%s' to be 'docomo', but got '%s'", `DoCoMo/2.0 SH01A(c100;TB;W24H16)`, result.Name)
}
if true && result.Os != "docomo" {
t.Errorf("Expected result.Os for '%s' to be 'docomo', but got '%s'", `DoCoMo/2.0 SH01A(c100;TB;W24H16)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `DoCoMo/2.0 SH01A(c100;TB;W24H16)`, result.OsVersion)
}
if true && result.Version != "SH01A" {
t.Errorf("Expected result.Version for '%s' to be 'SH01A', but got '%s'", `DoCoMo/2.0 SH01A(c100;TB;W24H16)`, result.Version)
}
}
result, err = Parse(`DoCoMo/2.0 N07B(c500;TB;W24H16)`)
if err != nil {
t.Errorf(`Failed to parse 'DoCoMo/2.0 N07B(c500;TB;W24H16)': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `DoCoMo/2.0 N07B(c500;TB;W24H16)`, result.Category)
}
if result.Name != "docomo" {
t.Errorf("Expected result.Name for '%s' to be 'docomo', but got '%s'", `DoCoMo/2.0 N07B(c500;TB;W24H16)`, result.Name)
}
if true && result.Os != "docomo" {
t.Errorf("Expected result.Os for '%s' to be 'docomo', but got '%s'", `DoCoMo/2.0 N07B(c500;TB;W24H16)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `DoCoMo/2.0 N07B(c500;TB;W24H16)`, result.OsVersion)
}
if true && result.Version != "N07B" {
t.Errorf("Expected result.Version for '%s' to be 'N07B', but got '%s'", `DoCoMo/2.0 N07B(c500;TB;W24H16)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)`, result.Category)
}
if result.Name != "docomo" {
t.Errorf("Expected result.Name for '%s' to be 'docomo', but got '%s'", `Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)`, result.Name)
}
if true && result.Os != "docomo" {
t.Errorf("Expected result.Os for '%s' to be 'docomo', but got '%s'", `Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)`, result.OsVersion)
}
if true && result.Version != "D505i" {
t.Errorf("Expected result.Version for '%s' to be 'D505i', but got '%s'", `Mozilla/5.0 (compatible; DoCoMo/1.0/D505i/c20/TB/W20H10; http://www.rcdtokyo.com/pc2m/)`, result.Version)
}
}
result, err = Parse(`DoCoMo/1.0/N505i/c20/TB/W24H12`)
if err != nil {
t.Errorf(`Failed to parse 'DoCoMo/1.0/N505i/c20/TB/W24H12': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `DoCoMo/1.0/N505i/c20/TB/W24H12`, result.Category)
}
if result.Name != "docomo" {
t.Errorf("Expected result.Name for '%s' to be 'docomo', but got '%s'", `DoCoMo/1.0/N505i/c20/TB/W24H12`, result.Name)
}
if true && result.Os != "docomo" {
t.Errorf("Expected result.Os for '%s' to be 'docomo', but got '%s'", `DoCoMo/1.0/N505i/c20/TB/W24H12`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `DoCoMo/1.0/N505i/c20/TB/W24H12`, result.OsVersion)
}
if true && result.Version != "N505i" {
t.Errorf("Expected result.Version for '%s' to be 'N505i', but got '%s'", `DoCoMo/1.0/N505i/c20/TB/W24H12`, result.Version)
}
}
result, err = Parse(`Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)`, result.Category)
}
if result.Name != "docomo" {
t.Errorf("Expected result.Name for '%s' to be 'docomo', but got '%s'", `Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)`, result.Name)
}
if true && result.Os != "docomo" {
t.Errorf("Expected result.Os for '%s' to be 'docomo', but got '%s'", `Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)`, result.OsVersion)
}
if true && result.Version != "N905imyu_W" {
t.Errorf("Expected result.Version for '%s' to be 'N905imyu_W', but got '%s'", `Mozilla/4.08 (N905imyu_W;FOMA;c500;TB)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (F02B;FOMA;like Gecko)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (F02B;FOMA;like Gecko)': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/5.0 (F02B;FOMA;like Gecko)`, result.Category)
}
if result.Name != "docomo" {
t.Errorf("Expected result.Name for '%s' to be 'docomo', but got '%s'", `Mozilla/5.0 (F02B;FOMA;like Gecko)`, result.Name)
}
if true && result.Os != "docomo" {
t.Errorf("Expected result.Os for '%s' to be 'docomo', but got '%s'", `Mozilla/5.0 (F02B;FOMA;like Gecko)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (F02B;FOMA;like Gecko)`, result.OsVersion)
}
if true && result.Version != "F02B" {
t.Errorf("Expected result.Version for '%s' to be 'F02B', but got '%s'", `Mozilla/5.0 (F02B;FOMA;like Gecko)`, result.Version)
}
}
}