Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capitalization and abbreviation normalizers can cause errors when combined #201

Open
orangejulius opened this issue Jun 22, 2020 · 0 comments
Labels

Comments

@orangejulius
Copy link
Member

orangejulius commented Jun 22, 2020

The fuzzy-tester has various "normalizers" for adjusting both the expected and actual value of test results to ignore minor differences, like capitalization.

Right now, combining these normalizers in certain ways can lead to false reports of test failures. This happens, at least in part, because normalizers such as abbreviateDirectionals operate only on capitalized variants of the directionals.

For example, here's the output of an autocomplete run with the following normalizer settings:

"normalizers": {                                                                                                                                          
  "street": [                                                                                                                                             
    "toLowerCase",                                                                                                                                     
    "abbreviateDirectionals"                                                                                                                              
  ]                                                                                                                                                       
},

Screenshot_2020-06-22_09-12-36

There's a distinctive pattern of "alternating" passes and fails. This is only an artifact of running the tests, and not actually a real thing.

Until we fix this, as a workaround, be sure to specify toUpperCase before any directional/abbreviation normalizers, and then optionally use toLowerCase after those normalizers if you want the output to be compared in lower case.

Here's the same test run with the following normalizers:

"normalizers": {                                                                                                                                          
   "street": [                                                                                                                                             
    "toUpperCase",                                                                                                                                        
    "abbreviateDirectionals",                                                                                                                             
    "toLowerCase"                                                                                                                                         
  ]                                                                                                                                                       
},      

Screenshot_2020-06-22_09-15-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant