Updated regexp for more robust ISO 8601 validation#656
Updated regexp for more robust ISO 8601 validation#656bricss wants to merge 10 commits intohapijs:masterfrom bricss:master
Conversation
There was a problem hiding this comment.
It looks like you've fundamentally changed some of the old tests why not just create new ones? Since this library is used across many projects we should make sure it functions like it used to as well as for the new functionality.
There was a problem hiding this comment.
This indeed changes the test too much, you basically removed the regexp from the equation.
|
Yep, it has some breaking changes in ISO 8601 validation, because current implementation do not cover full spec and some valid ISO 8601 dates do not pass validation. But I will add new test, its my bad. |
|
I'd like to include that in 6.5.0, do you need anything to get this moving ? |
|
I will add more tests today to cover all cases. |
|
Done. |
|
1st thing, I've improved your regexp with non-capturing groups, twice the performance ( 2nd, some of the strings pass (eg. 2013-06-07T23) that shouldn't. |
|
Ok, I will add this changes. |
|
I've tried your regexp and something went wrong, many date's now isn't passing validation -> https://regex101.com/r/rL6eJ5/1 |
|
Used without any side effect on joi's tests. |
|
I've just replace regexp in my fork and now 16 tests failing. |
|
Probably the markdown formatting, I've updated the comment to hopefully skip it, try again. |
|
Yep, now everything works like a charm, updated regexp & tests to bypass "2013-06-07T23" -> https://regex101.com/r/hB9vV0/1 |
|
I think you can revert many changes you did to the tests, the goal is to test the mix of constraints, not add "yes-constraints", this is testing the same thing over and over. |
|
Ok, will fix that. |
|
Do we need some additional changes to get this merged? |
|
The previous comment still stands. |
|
Finally removed the unnecessary tests. |
|
Looking forward to see this get merged in 👍 |
|
Merged and fixed, sorry the back and forth wasn't working. |
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Updated regexp for more robust ISO 8601 validation -> https://regex101.com/r/wA4cE0/1