-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpc_win_test.go
572 lines (569 loc) · 39.5 KB
/
pc_win_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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
/* This file is auto-generated! Any changes to this file will be lost! */
package woothee
import (
"testing"
)
func Test_pc_win(t *testing.T) {
var result *Result
var err error
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)`, 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; Windows NT 5.0; InfoPath.1)`, result.Name)
}
if true && result.Os != "Windows 2000" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 2000', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)`, result.Os)
}
if true && result.OsVersion != "NT 5.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)`, result.OsVersion)
}
if true && result.Version != "6.0" {
t.Errorf("Expected result.Version for '%s' to be '6.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)`, 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 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)`, result.OsVersion)
}
if true && result.Version != "7.0" {
t.Errorf("Expected result.Version for '%s' to be '7.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)`, 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 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)`, result.OsVersion)
}
if true && result.Version != "8.0" {
t.Errorf("Expected result.Version for '%s' to be '8.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 2004/11/08; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)`, 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 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)`, result.OsVersion)
}
if true && result.Version != "8.0" {
t.Errorf("Expected result.Version for '%s' to be '8.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; BOIE8;ENUSMSCOM)`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)`, 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 8.0; Windows NT 6.0; Trident/4.0)`, result.Name)
}
if true && result.Os != "Windows Vista" {
t.Errorf("Expected result.Os for '%s' to be 'Windows Vista', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)`, result.Os)
}
if true && result.OsVersion != "NT 6.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)`, result.OsVersion)
}
if true && result.Version != "8.0" {
t.Errorf("Expected result.Version for '%s' to be '8.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)`, 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 8.0; Windows NT 6.1; Trident/4.0)`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)`, result.OsVersion)
}
if true && result.Version != "8.0" {
t.Errorf("Expected result.Version for '%s' to be '8.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)`, result.OsVersion)
}
if true && result.Version != "9.0" {
t.Errorf("Expected result.Version for '%s' to be '9.0', but got '%s'", `Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)`, result.Name)
}
if true && result.Os != "Windows 8" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 8', but got '%s'", `Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)`, result.Os)
}
if true && result.OsVersion != "NT 6.2" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.2', but got '%s'", `Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)`, result.OsVersion)
}
if true && result.Version != "10.0" {
t.Errorf("Expected result.Version for '%s' to be '10.0', but got '%s'", `Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko`, result.OsVersion)
}
if true && result.Version != "11.0" {
t.Errorf("Expected result.Version for '%s' to be '11.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko`, result.Name)
}
if true && result.Os != "Windows 8.1" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 8.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko`, result.Os)
}
if true && result.OsVersion != "NT 6.3" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.3', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko`, result.OsVersion)
}
if true && result.Version != "11.0" {
t.Errorf("Expected result.Version for '%s' to be '11.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko`, result.OsVersion)
}
if true && result.Version != "11.0" {
t.Errorf("Expected result.Version for '%s' to be '11.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko`, result.OsVersion)
}
if true && result.Version != "11.0" {
t.Errorf("Expected result.Version for '%s' to be '11.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Name)
}
if true && result.Os != "Windows 8.1" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 8.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Os)
}
if true && result.OsVersion != "NT 6.3" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.3', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.OsVersion)
}
if true && result.Version != "11.0" {
t.Errorf("Expected result.Version for '%s' to be '11.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Category)
}
if result.Name != "Internet Explorer" {
t.Errorf("Expected result.Name for '%s' to be 'Internet Explorer', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Name)
}
if true && result.Os != "Windows 8.1" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 8.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Os)
}
if true && result.OsVersion != "NT 6.3" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.3', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.OsVersion)
}
if true && result.Version != "11.0" {
t.Errorf("Expected result.Version for '%s' to be '11.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko`, result.Version)
}
}
result, err = Parse(`Mozilla/4.78 [ja] (Win98; U)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.78 [ja] (Win98; U)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.78 [ja] (Win98; U)`, result.Category)
}
if result.Name != "UNKNOWN" {
t.Errorf("Expected result.Name for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/4.78 [ja] (Win98; U)`, result.Name)
}
if true && result.Os != "Windows 98" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 98', but got '%s'", `Mozilla/4.78 [ja] (Win98; U)`, result.Os)
}
if true && result.OsVersion != "98" {
t.Errorf("Expected result.OsVersion for '%s' to be '98', but got '%s'", `Mozilla/4.78 [ja] (Win98; U)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/4.78 [ja] (Win98; U)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)`, result.Category)
}
if result.Name != "UNKNOWN" {
t.Errorf("Expected result.Name for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240`, result.Category)
}
if result.Name != "Edge" {
t.Errorf("Expected result.Name for '%s' to be 'Edge', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240`, result.Name)
}
if true && result.Os != "Windows 10" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 10', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240`, result.Os)
}
if true && result.OsVersion != "NT 10.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 10.0', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24`, result.Category)
}
if result.Name != "Edge" {
t.Errorf("Expected result.Name for '%s' to be 'Edge', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24`, result.Name)
}
if true && result.Os != "Windows 10" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 10', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24`, result.Os)
}
if true && result.OsVersion != "NT 10.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 10.0', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.48 Safari/537.36 Edg/74.1.96.24`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13`, result.Category)
}
if result.Name != "Chrome" {
t.Errorf("Expected result.Name for '%s' to be 'Chrome', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13`, result.OsVersion)
}
if true && result.Version != "0.2.149.27" {
t.Errorf("Expected result.Version for '%s' to be '0.2.149.27', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1`, result.Category)
}
if result.Name != "Firefox" {
t.Errorf("Expected result.Name for '%s' to be 'Firefox', but got '%s'", `Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1`, result.Name)
}
if true && result.Os != "Windows Vista" {
t.Errorf("Expected result.Os for '%s' to be 'Windows Vista', but got '%s'", `Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1`, result.Os)
}
if true && result.OsVersion != "NT 6.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.0', but got '%s'", `Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1`, result.OsVersion)
}
if true && result.Version != "9.0.1" {
t.Errorf("Expected result.Version for '%s' to be '9.0.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.0; rv:9.0.1) Gecko/20100101 Firefox/9.0.1`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7`, result.Category)
}
if result.Name != "Safari" {
t.Errorf("Expected result.Name for '%s' to be 'Safari', but got '%s'", `Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7`, result.OsVersion)
}
if true && result.Version != "5.1.2" {
t.Errorf("Expected result.Version for '%s' to be '5.1.2', but got '%s'", `Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7`, result.Version)
}
}
result, err = Parse(`Opera/9.52 (Windows NT 5.1; U; ja)`)
if err != nil {
t.Errorf(`Failed to parse 'Opera/9.52 (Windows NT 5.1; U; ja)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Opera/9.52 (Windows NT 5.1; U; ja)`, result.Category)
}
if result.Name != "Opera" {
t.Errorf("Expected result.Name for '%s' to be 'Opera', but got '%s'", `Opera/9.52 (Windows NT 5.1; U; ja)`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Opera/9.52 (Windows NT 5.1; U; ja)`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Opera/9.52 (Windows NT 5.1; U; ja)`, result.OsVersion)
}
if true && result.Version != "9.52" {
t.Errorf("Expected result.Version for '%s' to be '9.52', but got '%s'", `Opera/9.52 (Windows NT 5.1; U; ja)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2`, result.Category)
}
if result.Name != "Vivaldi" {
t.Errorf("Expected result.Name for '%s' to be 'Vivaldi', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2`, result.Name)
}
if true && result.Os != "Windows 10" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 10', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2`, result.Os)
}
if true && result.OsVersion != "NT 10.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 10.0', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2`, result.OsVersion)
}
if true && result.Version != "1.0.380.2" {
t.Errorf("Expected result.Version for '%s' to be '1.0.380.2', but got '%s'", `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.88 Safari/537.36 Vivaldi/1.0.380.2`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64`, result.Category)
}
if result.Name != "Opera" {
t.Errorf("Expected result.Name for '%s' to be 'Opera', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64`, result.Name)
}
if true && result.Os != "Windows 8.1" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 8.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64`, result.Os)
}
if true && result.OsVersion != "NT 6.3" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.3', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64`, result.OsVersion)
}
if true && result.Version != "20.0.1387.64" {
t.Errorf("Expected result.Version for '%s' to be '20.0.1387.64', but got '%s'", `Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.64`, result.Version)
}
}
result, err = Parse(`Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0`, 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; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0`, result.OsVersion)
}
if true && result.Version != "6.0" {
t.Errorf("Expected result.Version for '%s' to be '6.0', but got '%s'", `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.8.0`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)`, result.Category)
}
if result.Name != "UNKNOWN" {
t.Errorf("Expected result.Name for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)`, result.Name)
}
if true && result.Os != "Windows Vista" {
t.Errorf("Expected result.Os for '%s' to be 'Windows Vista', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)`, result.Os)
}
if true && result.OsVersion != "NT 6.0" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.0', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows; U; Windows NT 6.0; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0`, result.Category)
}
if result.Name != "UNKNOWN" {
t.Errorf("Expected result.Name for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0`, result.Name)
}
if true && result.Os != "Windows XP" {
t.Errorf("Expected result.Os for '%s' to be 'Windows XP', but got '%s'", `Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0`, result.Os)
}
if true && result.OsVersion != "NT 5.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 5.1', but got '%s'", `Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36': %s`, err)
} else {
if result.Category != "pc" {
t.Errorf("Expected result.Category for '%s' to be 'pc', but got '%s'", `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36`, result.Category)
}
if result.Name != "Yandex Browser" {
t.Errorf("Expected result.Name for '%s' to be 'Yandex Browser', but got '%s'", `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36`, result.Name)
}
if true && result.Os != "Windows 7" {
t.Errorf("Expected result.Os for '%s' to be 'Windows 7', but got '%s'", `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36`, result.Os)
}
if true && result.OsVersion != "NT 6.1" {
t.Errorf("Expected result.OsVersion for '%s' to be 'NT 6.1', but got '%s'", `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36`, result.OsVersion)
}
if true && result.Version != "18.1.1.839" {
t.Errorf("Expected result.Version for '%s' to be '18.1.1.839', but got '%s'", `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 YaBrowser/18.1.1.839 Yowser/2.5 Safari/537.36`, result.Version)
}
}
}