3 ms·
Using tools is good, but also people should test them in their unit test, for what it should/should not be accepted If you're forbidding items beginning with n
by raverbashing 11y ago
Using tools is good, but also people should test them in their unit test, for what it should/should not be accepted
If you're forbidding items beginning with numbers, just have a test try passing '1a' and failing the match
- TeMPOraL 11y agoI agree of course. Unit tests like that are both basic sanity checks and, more importantly, protect you from stupid mistakes when the regexp has to be changed.