-
Notifications
You must be signed in to change notification settings - Fork 6
/
mobilephone_softbank_test.go
152 lines (149 loc) · 10.8 KB
/
mobilephone_softbank_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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/* This file is auto-generated! Any changes to this file will be lost! */
package woothee
import (
"testing"
)
func Test_mobilephone_softbank(t *testing.T) {
var result *Result
var err error
result, err = Parse(`SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`)
if err != nil {
t.Errorf(`Failed to parse 'SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.OsVersion)
}
if true && result.Version != "841SH" {
t.Errorf("Expected result.Version for '%s' to be '841SH', but got '%s'", `SoftBank/1.0/841SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Version)
}
}
result, err = Parse(`SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`)
if err != nil {
t.Errorf(`Failed to parse 'SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.OsVersion)
}
if true && result.Version != "004SH" {
t.Errorf("Expected result.Version for '%s' to be '004SH', but got '%s'", `SoftBank/2.0/004SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Version)
}
}
result, err = Parse(`SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`)
if err != nil {
t.Errorf(`Failed to parse 'SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.OsVersion)
}
if true && result.Version != "944SH" {
t.Errorf("Expected result.Version for '%s' to be '944SH', but got '%s'", `SoftBank/2.0/944SH/SHJ001/SN000000000000000 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Version)
}
}
result, err = Parse(`SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0`)
if err != nil {
t.Errorf(`Failed to parse 'SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0`, result.OsVersion)
}
if true && result.Version != "821SC" {
t.Errorf("Expected result.Version for '%s' to be '821SC', but got '%s'", `SoftBank/1.0/821SC/SCJ001/SN000000000000000 Flash/Flash-Lite/2.0`, result.Version)
}
}
result, err = Parse(`Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1`)
if err != nil {
t.Errorf(`Failed to parse 'Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.OsVersion)
}
if true && result.Version != "V905SH" {
t.Errorf("Expected result.Version for '%s' to be 'V905SH', but got '%s'", `Vodafone/1.0/V905SH/SHJ001 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1`, result.Version)
}
}
result, err = Parse(`Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0`)
if err != nil {
t.Errorf(`Failed to parse 'Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0`, result.OsVersion)
}
if true && result.Version != "V804SH" {
t.Errorf("Expected result.Version for '%s' to be 'V804SH', but got '%s'", `Vodafone/1.0/V804SH/SHJ001/SN0000000000000 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.3.2 Ext-V-Profile/VSCL-2.0.0`, result.Version)
}
}
result, err = Parse(`J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0`)
if err != nil {
t.Errorf(`Failed to parse 'J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0`, result.Category)
}
if result.Name != "SoftBank Mobile" {
t.Errorf("Expected result.Name for '%s' to be 'SoftBank Mobile', but got '%s'", `J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0`, result.Name)
}
if true && result.Os != "SoftBank" {
t.Errorf("Expected result.Os for '%s' to be 'SoftBank', but got '%s'", `J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0`, result.OsVersion)
}
if true && result.Version != "J-T51" {
t.Errorf("Expected result.Version for '%s' to be 'J-T51', but got '%s'", `J-PHONE/4.0/J-T51/SNXXXXXXXXX000000000 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0`, result.Version)
}
}
}