-
Notifications
You must be signed in to change notification settings - Fork 6
/
mobilephone_willcom_test.go
112 lines (109 loc) · 6.39 KB
/
mobilephone_willcom_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
/* This file is auto-generated! Any changes to this file will be lost! */
package woothee
import (
"testing"
)
func Test_mobilephone_willcom(t *testing.T) {
var result *Result
var err error
result, err = Parse(`Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4`, result.Category)
}
if result.Name != "WILLCOM" {
t.Errorf("Expected result.Name for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4`, result.Name)
}
if true && result.Os != "WILLCOM" {
t.Errorf("Expected result.Os for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4`, result.OsVersion)
}
if true && result.Version != "WX320T" {
t.Errorf("Expected result.Version for '%s' to be 'WX320T', but got '%s'", `Mozilla/3.0(WILLCOM;TOSHIBA/WX320T/2;1/1/C128) NetFront/3.4`, result.Version)
}
}
result, err = Parse(`Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3`, result.Category)
}
if result.Name != "WILLCOM" {
t.Errorf("Expected result.Name for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3`, result.Name)
}
if true && result.Os != "WILLCOM" {
t.Errorf("Expected result.Os for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3`, result.OsVersion)
}
if true && result.Version != "WX310SA" {
t.Errorf("Expected result.Version for '%s' to be 'WX310SA', but got '%s'", `Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3`, result.Version)
}
}
result, err = Parse(`Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX`, result.Category)
}
if result.Name != "Opera" {
t.Errorf("Expected result.Name for '%s' to be 'Opera', but got '%s'", `Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX`, result.Name)
}
if true && result.Os != "WILLCOM" {
t.Errorf("Expected result.Os for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX`, result.OsVersion)
}
if true && result.Version != "WX331K" {
t.Errorf("Expected result.Version for '%s' to be 'WX331K', but got '%s'", `Mozilla/3.0(WILLCOM;KYOCERA/WX331K/2;1.0.8.13.000000/0.1/C100) Opera 7.2 EX`, result.Version)
}
}
result, err = Parse(`Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0`, result.Category)
}
if result.Name != "WILLCOM" {
t.Errorf("Expected result.Name for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0`, result.Name)
}
if true && result.Os != "WILLCOM" {
t.Errorf("Expected result.Os for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0`, result.OsVersion)
}
if true && result.Version != "AH-J3001V,AH-J3002V" {
t.Errorf("Expected result.Version for '%s' to be 'AH-J3001V,AH-J3002V', but got '%s'", `Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0`, result.Version)
}
}
result, err = Parse(`Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0`, result.Category)
}
if result.Name != "Opera" {
t.Errorf("Expected result.Name for '%s' to be 'Opera', but got '%s'", `Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0`, result.Name)
}
if true && result.Os != "WILLCOM" {
t.Errorf("Expected result.Os for '%s' to be 'WILLCOM', but got '%s'", `Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0`, result.OsVersion)
}
if true && result.Version != "AH-K3001V" {
t.Errorf("Expected result.Version for '%s' to be 'AH-K3001V', but got '%s'", `Mozilla/3.0(DDIPOCKET;KYOCERA/AH-K3001V/1.4.1.67.000000/0.1/C100) Opera 7.0`, result.Version)
}
}
}