Popularity
7.2
Stable
Activity
0.0
Stable
6
6
9
Monthly Downloads: 10
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags:
Testing
QuickCheck
Latest version: v0.2.1.0
quickcheck-arbitrary-template alternatives and similar packages
Based on the "quickcheck" category.
Alternatively, view quickcheck-arbitrary-template alternatives based on common mentions on social networks and blogs.
-
quickcheck-state-machine
Test monadic programs using state machine based models -
quickcheck-arbitrary-adt
Typeclass for generating a list of each instance of a sum type's constructors -
quickcheck-instances
Instances for QuickCheck classes -
quickcheck-higherorder
QuickCheck extension for higher-order properties -
quickcheck-unicode
Unicode support for QuickCheck -
quickcheck-state-machine-distributed
Test monadic programs using state machine based models -
quickcheck-io
Use HUnit assertions as QuickCheck properties -
quickcheck-property-monad
A monad for building quickcheck properties -
quickcheck-with-counterexamples
Get counterexamples out of QuickCheck as Haskell values -
quickcheck-simple
Test properties and default-mains for QuickCheck -
quickcheck-combinators
type-level combinators for quickcheck instances -
quickcheck-report
Customizable reports for quickcheck properties -
tasty-quickcheck-laws
Tasty trees for your lawful class instances
Build time-series-based applications quickly and at scale.
InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.
Promo
www.influxdata.com
Do you think we are missing an alternative of quickcheck-arbitrary-template or a related project?
README
quickcheck-arbitrary-template
Test.QuickCheck.TH.GeneratorsSpec
contains one routine:
makeArbitrary
Which builds, a generator that can be used to create an arbitrary instance.
It does not create the instance directly for you.
It supports creating sum types and record types each constructor may have at most 7 arguments.
Installation
stack build
Usage
An example (from the tests)
{-# LANGUAGE TemplateHaskell #-}
module Test.QuickCheck.TH.GeneratorsSpec (tests) where
import Test.QuickCheck.TH.Generators
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Test.Tasty.HUnit
import Data.List
import Data.Ord
-- | These example types should build arbitrary instances correctly
data ExampleSumTypes = ExampleSum0
| ExampleSum1 Int
| ExampleSum2 Int Int
| ExampleSum3 Int Int Int
| ExampleSum4 Int Int Int Int
| ExampleSum5 Int Int Int Int Int
| ExampleSum6 Int Int Int Int Int Int
| ExampleSum7 Int Int Int Int Int Int
deriving (Show,Ord,Eq)
makeArbitrary ''ExampleSumTypes
instance Arbitrary ExampleSumTypes where
arbitrary = arbitraryExampleSumTypes
tests :: TestTree
tests = testGroup "Tests" [properties]
properties :: TestTree
properties = testGroup "Properties" [qcProps]
qcProps = testGroup "(checked by QuickCheck)"
[ QC.testProperty "sort == sort . reverse" (
\list -> sort (list :: [ExampleSumTypes]) == sort (reverse list)) ]
How to run tests
stack test quickcheck-arbitrary-template