-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmisc_test.go
712 lines (709 loc) · 34.7 KB
/
misc_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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
/* This file is auto-generated! Any changes to this file will be lost! */
package woothee
import (
"testing"
)
func Test_misc(t *testing.T) {
var result *Result
var err error
result, err = Parse(`AppleSyndication/56.1`)
if err != nil {
t.Errorf(`Failed to parse 'AppleSyndication/56.1': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `AppleSyndication/56.1`, result.Category)
}
if result.Name != "Safari RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'Safari RSSReader', but got '%s'", `AppleSyndication/56.1`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `AppleSyndication/56.1`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `AppleSyndication/56.1`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `AppleSyndication/56.1`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)`, result.Category)
}
if result.Name != "Google Desktop" {
t.Errorf("Expected result.Name for '%s' to be 'Google Desktop', but got '%s'", `Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (compatible; Google Desktop/5.9.1005.12335; http://desktop.google.com/)`, result.Version)
}
}
result, err = Parse(`Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)`)
if err != nil {
t.Errorf(`Failed to parse 'Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)`, result.Category)
}
if result.Name != "Windows RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'Windows RSSReader', but got '%s'", `Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)`, result.Name)
}
if false && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.0)`, result.Version)
}
}
result, err = Parse(`RssBar/1.29 (RssBar for unDonut 1.35)`)
if err != nil {
t.Errorf(`Failed to parse 'RssBar/1.29 (RssBar for unDonut 1.35)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `RssBar/1.29 (RssBar for unDonut 1.35)`, result.Category)
}
if result.Name != "RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'RSSReader', but got '%s'", `RssBar/1.29 (RssBar for unDonut 1.35)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `RssBar/1.29 (RssBar for unDonut 1.35)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `RssBar/1.29 (RssBar for unDonut 1.35)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `RssBar/1.29 (RssBar for unDonut 1.35)`, result.Version)
}
}
result, err = Parse(`MagpieRSS/0.61 (+http://magpierss.sf.net)`)
if err != nil {
t.Errorf(`Failed to parse 'MagpieRSS/0.61 (+http://magpierss.sf.net)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `MagpieRSS/0.61 (+http://magpierss.sf.net)`, result.Category)
}
if result.Name != "RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'RSSReader', but got '%s'", `MagpieRSS/0.61 (+http://magpierss.sf.net)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `MagpieRSS/0.61 (+http://magpierss.sf.net)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `MagpieRSS/0.61 (+http://magpierss.sf.net)`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `MagpieRSS/0.61 (+http://magpierss.sf.net)`, result.Version)
}
}
result, err = Parse(`gooRSSreader3.7 - build20090410`)
if err != nil {
t.Errorf(`Failed to parse 'gooRSSreader3.7 - build20090410': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `gooRSSreader3.7 - build20090410`, result.Category)
}
if result.Name != "RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'RSSReader', but got '%s'", `gooRSSreader3.7 - build20090410`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `gooRSSreader3.7 - build20090410`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `gooRSSreader3.7 - build20090410`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `gooRSSreader3.7 - build20090410`, result.Version)
}
}
result, err = Parse(`Fenrir Headline-Reader Plugin`)
if err != nil {
t.Errorf(`Failed to parse 'Fenrir Headline-Reader Plugin': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Fenrir Headline-Reader Plugin`, result.Category)
}
if result.Name != "RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'RSSReader', but got '%s'", `Fenrir Headline-Reader Plugin`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Fenrir Headline-Reader Plugin`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Fenrir Headline-Reader Plugin`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `Fenrir Headline-Reader Plugin`, result.Version)
}
}
result, err = Parse(`jsRSS++/3.15`)
if err != nil {
t.Errorf(`Failed to parse 'jsRSS++/3.15': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `jsRSS++/3.15`, result.Category)
}
if result.Name != "RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'RSSReader', but got '%s'", `jsRSS++/3.15`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `jsRSS++/3.15`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `jsRSS++/3.15`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `jsRSS++/3.15`, result.Version)
}
}
result, err = Parse(`cococ/1.06`)
if err != nil {
t.Errorf(`Failed to parse 'cococ/1.06': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `cococ/1.06`, result.Category)
}
if result.Name != "RSSReader" {
t.Errorf("Expected result.Name for '%s' to be 'RSSReader', but got '%s'", `cococ/1.06`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `cococ/1.06`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `cococ/1.06`, result.OsVersion)
}
if false && result.Version != "UNKNOWN" {
t.Errorf("Expected result.Version for '%s' to be 'UNKNOWN', but got '%s'", `cococ/1.06`, result.Version)
}
}
result, err = Parse(`Wget/1.12 (linux-gnu)`)
if err != nil {
t.Errorf(`Failed to parse 'Wget/1.12 (linux-gnu)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Wget/1.12 (linux-gnu)`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Wget/1.12 (linux-gnu)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Wget/1.12 (linux-gnu)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Wget/1.12 (linux-gnu)`, result.OsVersion)
}
if true && result.Version != "wget" {
t.Errorf("Expected result.Version for '%s' to be 'wget', but got '%s'", `Wget/1.12 (linux-gnu)`, result.Version)
}
}
result, err = Parse(`Apache-HttpClient/UNAVAILABLE (java 1.4)`)
if err != nil {
t.Errorf(`Failed to parse 'Apache-HttpClient/UNAVAILABLE (java 1.4)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Apache-HttpClient/UNAVAILABLE (java 1.4)`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Apache-HttpClient/UNAVAILABLE (java 1.4)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Apache-HttpClient/UNAVAILABLE (java 1.4)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Apache-HttpClient/UNAVAILABLE (java 1.4)`, result.OsVersion)
}
if true && result.Version != "Java" {
t.Errorf("Expected result.Version for '%s' to be 'Java', but got '%s'", `Apache-HttpClient/UNAVAILABLE (java 1.4)`, result.Version)
}
}
result, err = Parse(`livedoor HttpClient`)
if err != nil {
t.Errorf(`Failed to parse 'livedoor HttpClient': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `livedoor HttpClient`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `livedoor HttpClient`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `livedoor HttpClient`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `livedoor HttpClient`, result.OsVersion)
}
if true && result.Version != "Java" {
t.Errorf("Expected result.Version for '%s' to be 'Java', but got '%s'", `livedoor HttpClient`, result.Version)
}
}
result, err = Parse(`Jakarta Commons-HttpClient/3.0`)
if err != nil {
t.Errorf(`Failed to parse 'Jakarta Commons-HttpClient/3.0': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Jakarta Commons-HttpClient/3.0`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Jakarta Commons-HttpClient/3.0`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Jakarta Commons-HttpClient/3.0`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Jakarta Commons-HttpClient/3.0`, result.OsVersion)
}
if true && result.Version != "Java" {
t.Errorf("Expected result.Version for '%s' to be 'Java', but got '%s'", `Jakarta Commons-HttpClient/3.0`, result.Version)
}
}
result, err = Parse(`Java/1.5.0_17`)
if err != nil {
t.Errorf(`Failed to parse 'Java/1.5.0_17': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Java/1.5.0_17`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Java/1.5.0_17`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Java/1.5.0_17`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Java/1.5.0_17`, result.OsVersion)
}
if true && result.Version != "Java" {
t.Errorf("Expected result.Version for '%s' to be 'Java', but got '%s'", `Java/1.5.0_17`, result.Version)
}
}
result, err = Parse(`IE6.0,Java(TM) 2 Runtime Environment, Standard Edition`)
if err != nil {
t.Errorf(`Failed to parse 'IE6.0,Java(TM) 2 Runtime Environment, Standard Edition': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `IE6.0,Java(TM) 2 Runtime Environment, Standard Edition`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `IE6.0,Java(TM) 2 Runtime Environment, Standard Edition`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `IE6.0,Java(TM) 2 Runtime Environment, Standard Edition`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `IE6.0,Java(TM) 2 Runtime Environment, Standard Edition`, result.OsVersion)
}
if true && result.Version != "Java" {
t.Errorf("Expected result.Version for '%s' to be 'Java', but got '%s'", `IE6.0,Java(TM) 2 Runtime Environment, Standard Edition`, result.Version)
}
}
result, err = Parse(`libwww-perl/5.835`)
if err != nil {
t.Errorf(`Failed to parse 'libwww-perl/5.835': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `libwww-perl/5.835`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `libwww-perl/5.835`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `libwww-perl/5.835`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `libwww-perl/5.835`, result.OsVersion)
}
if true && result.Version != "perl" {
t.Errorf("Expected result.Version for '%s' to be 'perl', but got '%s'", `libwww-perl/5.835`, result.Version)
}
}
result, err = Parse(`WWW-Mechanize/1.64`)
if err != nil {
t.Errorf(`Failed to parse 'WWW-Mechanize/1.64': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `WWW-Mechanize/1.64`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `WWW-Mechanize/1.64`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `WWW-Mechanize/1.64`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `WWW-Mechanize/1.64`, result.OsVersion)
}
if true && result.Version != "perl" {
t.Errorf("Expected result.Version for '%s' to be 'perl', but got '%s'", `WWW-Mechanize/1.64`, result.Version)
}
}
result, err = Parse(`LWP::Simple/5.800`)
if err != nil {
t.Errorf(`Failed to parse 'LWP::Simple/5.800': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `LWP::Simple/5.800`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `LWP::Simple/5.800`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `LWP::Simple/5.800`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `LWP::Simple/5.800`, result.OsVersion)
}
if true && result.Version != "perl" {
t.Errorf("Expected result.Version for '%s' to be 'perl', but got '%s'", `LWP::Simple/5.800`, result.Version)
}
}
result, err = Parse(`LWP LDMusicNews::LDNewsAPI`)
if err != nil {
t.Errorf(`Failed to parse 'LWP LDMusicNews::LDNewsAPI': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `LWP LDMusicNews::LDNewsAPI`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `LWP LDMusicNews::LDNewsAPI`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `LWP LDMusicNews::LDNewsAPI`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `LWP LDMusicNews::LDNewsAPI`, result.OsVersion)
}
if true && result.Version != "perl" {
t.Errorf("Expected result.Version for '%s' to be 'perl', but got '%s'", `LWP LDMusicNews::LDNewsAPI`, result.Version)
}
}
result, err = Parse(`lwp-trivial/1.41`)
if err != nil {
t.Errorf(`Failed to parse 'lwp-trivial/1.41': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `lwp-trivial/1.41`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `lwp-trivial/1.41`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `lwp-trivial/1.41`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `lwp-trivial/1.41`, result.OsVersion)
}
if true && result.Version != "perl" {
t.Errorf("Expected result.Version for '%s' to be 'perl', but got '%s'", `lwp-trivial/1.41`, result.Version)
}
}
result, err = Parse(`Ruby`)
if err != nil {
t.Errorf(`Failed to parse 'Ruby': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Ruby`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Ruby`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Ruby`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Ruby`, result.OsVersion)
}
if true && result.Version != "ruby" {
t.Errorf("Expected result.Version for '%s' to be 'ruby', but got '%s'", `Ruby`, result.Version)
}
}
result, err = Parse(`feedzirra http://github.com/pauldix/feedzirra/tree/master`)
if err != nil {
t.Errorf(`Failed to parse 'feedzirra http://github.com/pauldix/feedzirra/tree/master': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `feedzirra http://github.com/pauldix/feedzirra/tree/master`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `feedzirra http://github.com/pauldix/feedzirra/tree/master`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `feedzirra http://github.com/pauldix/feedzirra/tree/master`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `feedzirra http://github.com/pauldix/feedzirra/tree/master`, result.OsVersion)
}
if true && result.Version != "ruby" {
t.Errorf("Expected result.Version for '%s' to be 'ruby', but got '%s'", `feedzirra http://github.com/pauldix/feedzirra/tree/master`, result.Version)
}
}
result, err = Parse(`Typhoeus - https://github.com/typhoeus/typhoeus`)
if err != nil {
t.Errorf(`Failed to parse 'Typhoeus - https://github.com/typhoeus/typhoeus': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Typhoeus - https://github.com/typhoeus/typhoeus`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Typhoeus - https://github.com/typhoeus/typhoeus`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Typhoeus - https://github.com/typhoeus/typhoeus`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Typhoeus - https://github.com/typhoeus/typhoeus`, result.OsVersion)
}
if true && result.Version != "ruby" {
t.Errorf("Expected result.Version for '%s' to be 'ruby', but got '%s'", `Typhoeus - https://github.com/typhoeus/typhoeus`, result.Version)
}
}
result, err = Parse(`Python-urllib/1.16`)
if err != nil {
t.Errorf(`Failed to parse 'Python-urllib/1.16': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Python-urllib/1.16`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Python-urllib/1.16`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Python-urllib/1.16`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Python-urllib/1.16`, result.OsVersion)
}
if true && result.Version != "python" {
t.Errorf("Expected result.Version for '%s' to be 'python', but got '%s'", `Python-urllib/1.16`, result.Version)
}
}
result, err = Parse(`Twisted PageGetter`)
if err != nil {
t.Errorf(`Failed to parse 'Twisted PageGetter': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Twisted PageGetter`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Twisted PageGetter`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Twisted PageGetter`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Twisted PageGetter`, result.OsVersion)
}
if true && result.Version != "python" {
t.Errorf("Expected result.Version for '%s' to be 'python', but got '%s'", `Twisted PageGetter`, result.Version)
}
}
result, err = Parse(`PHP/5.2.13`)
if err != nil {
t.Errorf(`Failed to parse 'PHP/5.2.13': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `PHP/5.2.13`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `PHP/5.2.13`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `PHP/5.2.13`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `PHP/5.2.13`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `PHP/5.2.13`, result.Version)
}
}
result, err = Parse(`PHP`)
if err != nil {
t.Errorf(`Failed to parse 'PHP': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `PHP`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `PHP`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `PHP`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `PHP`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `PHP`, result.Version)
}
}
result, err = Parse(`PEAR HTTP_Request class`)
if err != nil {
t.Errorf(`Failed to parse 'PEAR HTTP_Request class': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `PEAR HTTP_Request class`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `PEAR HTTP_Request class`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `PEAR HTTP_Request class`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `PEAR HTTP_Request class`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `PEAR HTTP_Request class`, result.Version)
}
}
result, err = Parse(`HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6`)
if err != nil {
t.Errorf(`Failed to parse 'HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `HTTP_Request2/2.1.1 (http://pear.php.net/package/http_request2) PHP/5.3.10-1ubuntu3.6`, result.Version)
}
}
result, err = Parse(`PECL::HTTP/1.7.4 (PHP/5.4.4)`)
if err != nil {
t.Errorf(`Failed to parse 'PECL::HTTP/1.7.4 (PHP/5.4.4)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `PECL::HTTP/1.7.4 (PHP/5.4.4)`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `PECL::HTTP/1.7.4 (PHP/5.4.4)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `PECL::HTTP/1.7.4 (PHP/5.4.4)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `PECL::HTTP/1.7.4 (PHP/5.4.4)`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `PECL::HTTP/1.7.4 (PHP/5.4.4)`, result.Version)
}
}
result, err = Parse(`WordPress/3.2.1; http://www.painlog.jp`)
if err != nil {
t.Errorf(`Failed to parse 'WordPress/3.2.1; http://www.painlog.jp': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `WordPress/3.2.1; http://www.painlog.jp`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `WordPress/3.2.1; http://www.painlog.jp`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `WordPress/3.2.1; http://www.painlog.jp`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `WordPress/3.2.1; http://www.painlog.jp`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `WordPress/3.2.1; http://www.painlog.jp`, result.Version)
}
}
result, err = Parse(`CakePHP`)
if err != nil {
t.Errorf(`Failed to parse 'CakePHP': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `CakePHP`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `CakePHP`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `CakePHP`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `CakePHP`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `CakePHP`, result.Version)
}
}
result, err = Parse(`PukiWiki/1.4.6`)
if err != nil {
t.Errorf(`Failed to parse 'PukiWiki/1.4.6': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `PukiWiki/1.4.6`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `PukiWiki/1.4.6`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `PukiWiki/1.4.6`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `PukiWiki/1.4.6`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `PukiWiki/1.4.6`, result.Version)
}
}
result, err = Parse(`Mozilla/5.0 (compatible; PEAR HTTP_Request class;)`)
if err != nil {
t.Errorf(`Failed to parse 'Mozilla/5.0 (compatible; PEAR HTTP_Request class;)': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `Mozilla/5.0 (compatible; PEAR HTTP_Request class;)`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `Mozilla/5.0 (compatible; PEAR HTTP_Request class;)`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (compatible; PEAR HTTP_Request class;)`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `Mozilla/5.0 (compatible; PEAR HTTP_Request class;)`, result.OsVersion)
}
if true && result.Version != "php" {
t.Errorf("Expected result.Version for '%s' to be 'php', but got '%s'", `Mozilla/5.0 (compatible; PEAR HTTP_Request class;)`, result.Version)
}
}
result, err = Parse(`curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2`)
if err != nil {
t.Errorf(`Failed to parse 'curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2': %s`, err)
} else {
if result.Category != "misc" {
t.Errorf("Expected result.Category for '%s' to be 'misc', but got '%s'", `curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2`, result.Category)
}
if result.Name != "HTTP Library" {
t.Errorf("Expected result.Name for '%s' to be 'HTTP Library', but got '%s'", `curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2`, result.Name)
}
if true && result.Os != "UNKNOWN" {
t.Errorf("Expected result.Os for '%s' to be 'UNKNOWN', but got '%s'", `curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2`, result.Os)
}
if false && result.OsVersion != "UNKNOWN" {
t.Errorf("Expected result.OsVersion for '%s' to be 'UNKNOWN', but got '%s'", `curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2`, result.OsVersion)
}
if true && result.Version != "curl" {
t.Errorf("Expected result.Version for '%s' to be 'curl', but got '%s'", `curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2`, result.Version)
}
}
}