Closed EltonLobo07 closed 3 weeks ago
Do you think I have covered the majority of the cases? If not, can you help me understand what you mean by cover all possible scenarios based on the regex used
?
This is our IP v4 regex:
/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u
The idea is basically to test the entire regex definition, so if we accidentally change the regex in the future, our tests should fail and warn us.
For example, if a regex contains the pattern [3-6]
, we should have a positive test for 3
, 6
, and optionally a value in between, and a negative test for 2
and 7
.
Thank you very much! I am busy this weekend, but I will try to review it next week.
I think I can improve the added test cases. I'll let you know once I am done (probably tomorrow) so that you can review the changes then.
Updated. Feel free to review the PR.
Open in Stackblitz
commit:
cd70108