Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module is intended to be imported qualified
, for example:
import qualified Test.Tasty.Lens.Setter as Setter
- test :: (Eq s, Show s, Show a, Serial IO s, Serial IO a, Serial Identity a, Serial IO (a -> a)) => Setter' s a -> TestTree
- testSeries :: (Eq s, Show s, Show a, Serial IO a, Serial Identity a, Serial IO (a -> a)) => Setter' s a -> Series IO s -> TestTree
- testExhaustive :: (Eq s, Show s, Show a, Serial IO s, Serial IO a, Serial Identity a, Serial IO (a -> a)) => Setter' s a -> TestTree
- module Test.SmallCheck.Lens.Setter
Tests
test :: (Eq s, Show s, Show a, Serial IO s, Serial IO a, Serial Identity a, Serial IO (a -> a)) => Setter' s a -> TestTree Source
A Setter
is only legal if the following laws hold:
set l y (set l x a) ≡ set l y a
over l id ≡ id
over l f . over l g ≡ over l (f . g)
The Serial
and CoSerial
instances for s
and a
. If you are
not creating your own orphan instances be aware of combinatorial explosion
since the default implementations usually aim for exhaustivity.
In this case f
and g
are of type a -> a
and when combining them the
sum of Series
is used.
testSeries :: (Eq s, Show s, Show a, Serial IO a, Serial Identity a, Serial IO (a -> a)) => Setter' s a -> Series IO s -> TestTree Source
A Setter
is only legal if the following laws hold:
set l y (set l x a) ≡ set l y a
over l id ≡ id
over l f . over l g ≡ over l (f . g)
Here you explicitly pass a custom Series
for s
, while for a
the
Serial
instance is used. If you want to fine tune both Series
, you
should create your own TestTree
.
In this case f
and g
are of type a -> a
and when combining them the
sum of Series
is used.
testExhaustive :: (Eq s, Show s, Show a, Serial IO s, Serial IO a, Serial Identity a, Serial IO (a -> a)) => Setter' s a -> TestTree Source
Re-exports
module Test.SmallCheck.Lens.Setter