Package0.2.1.3TestTesting
microspec
Tiny QuickCheck test library with minimal dependencies
- Version0.2.1.3
- CategoryTest, Testing
- LicenceBSD-3-Clause
- AuthorTom Murphy
- MaintainerTom Murphy
- Pinned byhackage microspec 0.2.1.3
- Sourcehackage.haskell.org/package/microspec-0.2.1.3
Modules
1 module- Test.Microspec231Tests can be structured as nested it / describe statements E.g. microspec $ do
Description
A tiny (1 module, <500 lines) property-based (and unit) testing library with minimal dependencies.
Instead of reinventing the wheel (https://xkcd.com/927), we use a RSpec/HSpec-like DSL and run tests with QuickCheck.
For many use-cases, microspec is a drop-in replacement for hspec.
import Test.Microspec main :: IO () main = microspec $ do describe "replicate" $ do it "doubles with 2" $ replicate 2 'x' === "xx" it "creates a list of the right size" $ \(Positive n) -> length (replicate n 'x') === n describe "reverse" $ do it "reverse . reverse === id" $ \l -> reverse (reverse l) === (l :: [Int]) describe "tail" $ it "length is -1" $ \(NonEmpty l) -> length (tail l :: [Int]) === length l - 1 describe "solve the halting problem" $ pending
Depends on
3 packages- QuickCheck-2.15.0.1in this set
- base-4.20.2.0with GHC
- time-1.12.2with GHC
Used by in this set · 0
Nothing in this set depends on it.