dev-haskell/microspec (haskell)

Search

Package Information

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
Homepage:
https://hackage.haskell.org/package/microspec
License:
BSD

Versions

Version EAPI Keywords Slot
0.2.1.3 8 ~amd64 0/0.2.1.3

Metadata

Description

Maintainers

Raw Metadata XML
<pkgmetadata>
	<maintainer type="project">
		<email>haskell@gentoo.org</email>
		<name>Gentoo Haskell</name>
	</maintainer>
	<longdescription>
		A tiny (1 module, &lt;500 lines) property-based (and unit) testing library with minimal dependencies.
		
		Instead of reinventing the wheel (&lt;https://xkcd.com/927&gt;), we use a
		RSpec/HSpec-like DSL and run tests with QuickCheck.
		
		For many use-cases, microspec is a drop-in replacement for hspec.
		
		&gt; import Test.Microspec
		&gt;
		&gt; main :: IO ()
		&gt; main = microspec $ do
		&gt;    describe &quot;replicate&quot; $ do
		&gt;       it &quot;doubles with 2&quot; $
		&gt;          replicate 2 &#39;x&#39; === &quot;xx&quot;
		&gt;       it &quot;creates a list of the right size&quot; $
		&gt;          \(Positive n) -&gt; length (replicate n &#39;x&#39;) === n
		&gt;
		&gt;    describe &quot;reverse&quot; $ do
		&gt;       it &quot;reverse . reverse === id&quot; $ \l -&gt;
		&gt;          reverse (reverse l) === (l :: [Int])
		&gt;
		&gt;    describe &quot;tail&quot; $
		&gt;       it &quot;length is -1&quot; $ \(NonEmpty l) -&gt;
		&gt;          length (tail l :: [Int]) === length l - 1
		&gt;
		&gt;    describe &quot;solve the halting problem&quot; $
		&gt;       pending
	</longdescription>
</pkgmetadata>

Lint Warnings

Manifest

Type File Size Versions
DIST microspec-0.2.1.3.tar.gz 5693 bytes 0.2.1.3
Unmatched Entries
Type File Size