de-sh / kvdb

A simple experimental KeyValue database, built with rust.
MIT License
9 stars 1 forks source link

Add tests #6

Open de-sh opened 4 years ago

de-sh commented 4 years ago

Please leave comments to further discuss the addition of tests to the repo.

de-sh commented 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.

allevo commented 4 years ago

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:

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 😄

de-sh commented 4 years ago

Yes, that sounds right

de-sh commented 4 years ago

Thanks to @allevo for contributing unit test for parser.rs and store.rs 🥳