Open de-sh opened 4 years ago
As discussed in the comments on @allevo 's PR. We need to consider the approach for our testing strategy. A good idea would be as outlined in this comment. There is a need to understand better, the pitfalls of such an approach.
From my point of view, tests should describe the behaviour of the code. From this point, tests separation should be considered when different subject or different circumstance happen. For making some examples:
get
and set
methods I will write two different tests;get
behaviour for getting an existing key or an unknown one, I will write two different tests;Another test I consider when I test the code is the flow: that kind of test allows me to be sure that the invoking that sequence of method works fine.
Anyway this is only my point of view. I'm sure there're some other better tips 😄
Yes, that sounds right
Thanks to @allevo for contributing unit test for parser.rs
and store.rs
🥳
Please leave comments to further discuss the addition of tests to the repo.