Adds unit tests for Case, Cases, StartsWith, and EndsWith with a variety of different argument types.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I'll hold off on uploading the other patches, since how I write the tests for the lower versions depends on what your comments are on this patch.
Comment Actions
I was all prepared to not like this approach for testing. But it looks really, really nice. I've got nothing to really suggest here other than some test cases you should probably add:
- purely length-delimited cases.
- edge cases with '\0' bytes in the middle of the string
- '\0' in the middle of the case
- '\0' in the middle of the input
For the latter: I think the formation of the StringRef will handle all of this and you'll just show that whatever length the StringRef has, that's the length that is used. But good to document this fact so folks don't go and switch the code to use strncmp for some weird reason.
Feel free to submit with whatever you come up with here.