5 ms·
Seriously, just write one unit test for your regex.
by febeling 2y ago
Seriously, just write one unit test for your regex.
- mannykannot 2y agoIndeed, one should test any regex one puts any trust in, but the problem is that if you take as a fact something that is actually a false assumption (as the author did here), your test may well fail to find errors which may cause faults when the regex is put to use. This, in a nutshell, is the sort of problem which renders fallacious the notion that you can unit-test your way to correct software.