How do you write unit test for a regex pattern?

Is it possible? Will this require existing whitened and / or blacklisted datasets, or not? How do you know that there is no exception?

+3
source share
2 answers

whitelists and blacklists sound good, I don’t think you can “prove” that it will work without exception, so the empirical test is appropriate and consistent with the spirit of unit testing

since you come up with more complex / edge testing examples, just add them and see if everything works by creating a test suite in which you have an increasingly high level of trust.

,

unit test ?

+3

, :

unit test ?
unit test ?

+2

Source: https://habr.com/ru/post/1770528/


All Articles