-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmobilephone_au_test.go
92 lines (89 loc) · 4.92 KB
/
mobilephone_au_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
/* This file is auto-generated! Any changes to this file will be lost! */
package woothee
import (
"testing"
)
func Test_mobilephone_au(t *testing.T) {
var result *Result
var err error
result, err = Parse(`KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0`)
if err != nil {
t.Errorf(`Failed to parse 'KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0`, result.Category)
}
if result.Name != "au by KDDI" {
t.Errorf("Expected result.Name for '%s' to be 'au by KDDI', but got '%s'", `KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0`, result.Name)
}
if true && result.Os != "au" {
t.Errorf("Expected result.Os for '%s' to be 'au', but got '%s'", `KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0`, result.OsVersion)
}
if true && result.Version != "TS3V" {
t.Errorf("Expected result.Version for '%s' to be 'TS3V', but got '%s'", `KDDI-TS3V UP.Browser/6.2_7.2.7.1.K.6.210 (GUI) MMP/2.0`, result.Version)
}
}
result, err = Parse(`KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0`)
if err != nil {
t.Errorf(`Failed to parse 'KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0`, result.Category)
}
if result.Name != "au by KDDI" {
t.Errorf("Expected result.Name for '%s' to be 'au by KDDI', but got '%s'", `KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0`, result.Name)
}
if true && result.Os != "au" {
t.Errorf("Expected result.Os for '%s' to be 'au', but got '%s'", `KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0`, result.OsVersion)
}
if true && result.Version != "CA3H" {
t.Errorf("Expected result.Version for '%s' to be 'CA3H', but got '%s'", `KDDI-CA3H UP.Browser/6.2_7.2.7.1.K.5.207 (GUI) MMP/2.0`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1`, result.Category)
}
if result.Name != "Opera" {
t.Errorf("Expected result.Name for '%s' to be 'Opera', but got '%s'", `Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1`, result.Name)
}
if true && result.Os != "au" {
t.Errorf("Expected result.Os for '%s' to be 'au', but got '%s'", `Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1`, result.OsVersion)
}
if true && result.Version != "SH3F" {
t.Errorf("Expected result.Version for '%s' to be 'SH3F', but got '%s'", `Mozilla/5.0 Opera/9.5 (KDDI-SH3F; BREW; Opera Mobi; U; ja) Presto/2.2.1`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]': %s`, err)
} else {
if result.Category != "mobilephone" {
t.Errorf("Expected result.Category for '%s' to be 'mobilephone', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]`, result.Name)
}
if true && result.Os != "au" {
t.Errorf("Expected result.Os for '%s' to be 'au', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]`, result.OsVersion)
}
if true && result.Version != "CA3B" {
t.Errorf("Expected result.Version for '%s' to be 'CA3B', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; KDDI-CA3B) Opera 8.60 [ja]`, result.Version)
}
}
}