5 ms·
How are they hard to test? Given input x, expect output y. It's one of the easiest things in the world to test.
by flukus 10y ago
How are they hard to test? Given input x, expect output y. It's one of the easiest things in the world to test.
- Niksko 10y agoThe point of this post is that even though the regex behaves correctly (input x produces expected output y), you also need to consider performance constraints. Without fuzzing, it's going to be pretty difficult to come up with enough test cases to thoroughly test a regex.
- qw 10y agoWouldn't the same apply to a custom method? Why would code using a combination of indexOf(), substring() and trim() be any less foolproof on arbitrary data?
- deleted 10y ago[deleted]
- mattmanser 10y agoYeah, testing what you expect in regexes is super easy. Edge case testing is not though. Just like exactly what happened in the post this discussion is about..
- hinkley 10y agoWhere do you think you are, right now?
- wpears 10y agoWhere x can be any combination of letters of any length?