2015-07-19 06:39:39 +03:00
|
|
|
flags: {}
|
2015-10-08 14:05:59 +03:00
|
|
|
|
2015-07-19 06:39:39 +03:00
|
|
|
packages:
|
2016-06-20 23:45:34 +03:00
|
|
|
- concurrency
|
2015-10-05 18:44:14 +03:00
|
|
|
- dejafu
|
2015-12-01 08:03:31 +03:00
|
|
|
- dejafu-tests
|
2016-06-20 23:45:34 +03:00
|
|
|
- hunit-dejafu
|
|
|
|
- tasty-dejafu
|
2017-05-31 17:08:06 +03:00
|
|
|
# Until test-framework-hunit with HUnit 1.6 support is on Stackage:
|
2017-03-20 21:42:51 +03:00
|
|
|
# https://github.com/haskell/test-framework/pull/27
|
|
|
|
- location:
|
2017-05-31 17:08:06 +03:00
|
|
|
git: https://github.com/haskell/test-framework.git
|
|
|
|
commit: 7d9c1a67f41da960152657728da7813c533573f2
|
2017-03-20 21:42:51 +03:00
|
|
|
subdirs:
|
|
|
|
- hunit
|
|
|
|
extra-dep: true
|
2015-10-08 14:05:59 +03:00
|
|
|
|
2017-03-20 21:42:51 +03:00
|
|
|
extra-deps:
|
|
|
|
- call-stack-0.1.0
|
|
|
|
- HUnit-1.6.0.0
|
Implement refinement property testing
This lets dejafu test CoCo-style properties, and introduces a
dependency on [leancheck][].
For example, consider this statement about MVars: "using readMVar is
better than a takeMVar followed by a putMVar because the former is
atomic but the latter is not."
This module can test properties like that:
```
sig e = Sig
{ initialise = maybe newEmptyMVar newMVar
, observe = \v _ -> tryReadMVar v
, interfere = \v s -> tryTakeMVar v >>
maybe (pure ()) (void . tryPutMVar v) s
, expr = e
}
> check $ sig (void . readMVar) `equivalentTo`
sig (\v -> takeMVar v >>= putMVar v)
*** Failure: (seed Just ())
left: [(Nothing,Just ())]
right: [(Nothing,Just ()),(Just Deadlock,Just ())]
```
The two expressions are not equivalent, and we get given the
counterexample!
In addition to "equivalentTo", there is also "refines" and
"strictlyRefines" (and negated variants)
[leancheck]: https://hackage.haskell.org/package/leancheck
2017-05-31 15:15:50 +03:00
|
|
|
- leancheck-0.6.2
|
2015-10-08 14:05:59 +03:00
|
|
|
|
2016-06-22 12:35:02 +03:00
|
|
|
resolver: nightly-2016-06-20
|
2017-03-20 21:42:51 +03:00
|
|
|
|
|
|
|
nix:
|
|
|
|
packages: [git]
|