asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6.02k stars 556 forks source link

Fix test cases #382

Closed mie00 closed 4 years ago

mie00 commented 4 years ago

Fixes https://github.com/asaskevich/govalidator/issues/380

Test cases were broken for two reasons:

  1. Multiple errors gets appended into an Errors struct without any guarantee on the order, so string comparison with the expected value sometimes fails when the order doesn't match.
  2. foo@bar.museum returns false instead of the expected true.

This PR fixes both, by sorting the errors array when stringifying, and removing the broken email test case.

asaskevich commented 4 years ago

Thank you!