containers-backpack icon indicating copy to clipboard operation
containers-backpack copied to clipboard

Discuss separation on unit tests and property-based tests

Open chshersh opened this issue 7 years ago • 0 comments

Some tests introduced in #34 are unit tests and some are property-based tests. It would be really nice to somehow separate tests. For example, this one is unit test:

https://github.com/kowainik/containers-backpack/blob/c84b22f7551bd34183ac76ff20dd4e4fa4cd6f48/containers-contrib-readonly/src/Map/Contrib/Laws.hs#L21-L22

But this looks like property-based test:

https://github.com/kowainik/containers-backpack/blob/c84b22f7551bd34183ac76ff20dd4e4fa4cd6f48/containers-contrib-readonly/src/Map/Contrib/Laws.hs#L65-L72

I would love to have 3 test-suites:

  1. test-suite for unit tests
  2. test-suite for property tests
  3. One test suite that combines them all.

My proposal is to use hspec for unit tests. QuickCheck can be used now for property-based tests.

chshersh avatar Oct 23 '18 02:10 chshersh