ua-parser / uap-core

The regex file necessary to build language ports of Browserscope's user agent parser.
Other
752 stars 451 forks source link

Broken test case(s) when implementing `patch_minor` in user agent parser? #562

Closed masklinn closed 7 months ago

masklinn commented 1 year ago

It might be an error in my implementation, but when trying to add patch_minor to the "user agent" parser I'm getting mismatches: test_ua has the following case: https://github.com/ua-parser/uap-core/blob/d668d6c6157db7737edfc0280adc6610c1b88029/tests/test_ua.yaml#L1478-L1483 as far as I can tell this should match the following rule: https://github.com/ua-parser/uap-core/blob/d668d6c6157db7737edfc0280adc6610c1b88029/regexes.yaml#L850-L851 but the rule has 5 groups, so it is capturing patch_minor: '0' not null is it not?

And the reverse issue, https://github.com/ua-parser/uap-core/blob/d668d6c6157db7737edfc0280adc6610c1b88029/tests/test_ua.yaml#L6754-L6759 should match https://github.com/ua-parser/uap-core/blob/d668d6c6157db7737edfc0280adc6610c1b88029/regexes.yaml#L176-L177 but the regex only has 4 groups including the family, so there should be no capture of the patch_minor.

masklinn commented 7 months ago

resolved by #579