tezos-checker / checker

An in-development "robocoin" system for the Tezos blockchain
24 stars 16 forks source link

Add some unit tests for cfmm views #176

Closed gkaracha closed 3 years ago

gkaracha commented 3 years ago

Test coverage also increases (from 84.32% to 85.14%).

purcell commented 3 years ago

I also pushed an extra commit here. PS. ounit2 also has a "bracket" combinator which might well be useful in some cases where there is common setup code: https://gildor478.github.io/ounit/ounit2/OUnit/index.html#bracket

gkaracha commented 3 years ago

Thanks! Good tip for the bracket also, I didn't know of it but I'm pretty sure we have quite some setup, here and there. Might come in handy :+1:

purcell commented 3 years ago

I forgot to mention that one general point here was something that I've seen in any number of languages with test frameworks: whenever you can refactor a test with multiple clauses into multiple tests, you potentially get more granular and useful failures. So although there's also a benefit to eliminating the possibility of consecutive clauses affecting each other via side effects, the granularity was what prompted me to add the refactoring commit.