quickcheck Questions

1

Something did not make sense with a Cabal package I was developing, and I have boiled the issue down to the following example: I have the following simple test module: module Main where import Te...
Crispy asked 24/4, 2015 at 7:9

2

Solved

Consider the following tests for the distributivity law between reverse and ++, import Test.QuickCheck test :: [Int] -> [Int] -> Bool test xs ys = reverse (xs ++ ys) == reverse xs ++ rever...
Mercy asked 8/4, 2015 at 5:30

1

I'd like to use Haskell's quickcheck library test some C code. The easiest way seems to be doing a foreign import and write a property on top of the resulting haskell function. The problem with thi...
Kinder asked 8/8, 2014 at 10:12

2

Is there a cookbook available for converting from QuickCheck1 to QuickCheck2? As some examples, defaultConfig (replaced by Args) and trivial were removed and CoArbitrary introduced. I did read th...
Waldo asked 23/5, 2012 at 1:34

11

Solved

Quickcheck and its variants (even there is one in Java), seems to be interesting. However, apart from academic interest, is it really useful in a real application testing (Eg. a GUI applicati...
Ogrady asked 23/2, 2009 at 8:33

1

I have a function arbExample to generate a random Example data type which depends on a numbers of functions. I am trying to do some property testing by doing quickCheck prop_example, the problem ...
Kushner asked 22/11, 2014 at 2:53

1

Solved

Let's suppose I have no the HsColour program installed and I install QuickCheck $ cd /tmp/ $ cabal get QuickCheck $ cd QuickCheck $ cabal install ... [ 1 of 15] Compiling Test.QuickCheck.Random ...
Trio asked 6/11, 2014 at 16:55

1

Solved

I implemented W3s recommended algorithm for converting SVG-path arcs from endpoint-arcs to center-arcs and back in Haskell. type EndpointArc = ( Double, Double, Double, Double , Bool, Bool, Doub...
Subspecies asked 16/11, 2014 at 11:26

4

Solved

Every time I run "quickCheck prop_xyz", a new random seed is used. How do I enforce QuickCheck to always use the same random seed? Thanks!
Yellowhammer asked 4/10, 2013 at 19:41

1

Solved

I have occasionally seen people say that the Gen type in QuickCheck does not obey the monad laws, though I have not seen much of an explanation to go with it. Now, QuickCheck 2.7's Test.QuickCheck....
Fossilize asked 30/6, 2014 at 0:50

1

Solved

I am writing Vector and Matrix data types that are dependently typed. data Vector n e where EmptyVector :: Vector Zero e (:>) :: e -> Vector n e -> Vector (Succ n) e deriving instance ...
Isherwood asked 7/6, 2014 at 4:46

3

Solved

I have a QuickCheck property that looks like this: prop42 :: Foo -> Bool prop42 foo = fn1 foo == fn2 foo If this property fails, it will print out what foo was. But I'd really like to know wh...
Virtuous asked 25/2, 2014 at 14:2

1

Solved

I am using Haskell and QuickCheck to write a test for the following function: {-| Given a list of points and a direction, find the point furthest along in that direction. -} fn :: (Eq a, Ord a, D...
Todd asked 16/2, 2014 at 2:8

1

Solved

I've got the following property I want to test using quickcheck: prop_zip xs ys = length xs == length ys ==> unzip (zip xs ys) == (xs,ys) Eventhough it seems to be logically right according...
Adham asked 10/2, 2014 at 11:5

2

Solved

Are there any extensions to HUnit or QuickCheck that allow a continuous integration system like Bamboo to do detailed reporting of test results? So far, my best idea is to simply trigger the test...
Kenosis asked 10/7, 2011 at 21:46

1

Solved

I am using Haskell and Parsec to parse a file format. My parsing function looks something like: parseInput :: String -> Model parseInput input = ... data Model = Model { mNumV :: Int, mNumF ::...
Specht asked 16/1, 2014 at 7:40

4

Solved

As a programmer, I have bought whole-heartedly into the TDD philosophy and take the effort to make extensive unit tests for any nontrivial code I write. Sometimes this road can be painful (behavior...
Nape asked 20/4, 2009 at 4:14

2

Solved

I've seen how QuickCheck can be used to test monadic and non-monadic code, but how can I use it to test code that handles errors, i.e., prints some message and then calls exitWith?
Marcionism asked 1/9, 2013 at 18:48

1

Solved

I am using QuickCheck to test the following program: {-# LANGUAGE TemplateHaskell #-} import Test.QuickCheck import Test.QuickCheck.All elementAt :: (Integral b) => [a] -> b -> a elemen...
Max asked 29/8, 2013 at 5:17

2

Solved

I have a function with the following type signature rndListIndex :: Double -> Double -> Double -> Double rndListIndex maxIdx r1 r2 = … the first input should be a value coming from a n...
Priam asked 23/8, 2013 at 17:11

1

Solved

I am trying out a simple rose tree code. data RoseT a = Leaf a | Node a [RoseT a] deriving (Show) instance Eq (RoseT a) where (==) (Leaf a) (Leaf b) = a == b (==) (Node a rs1) (Node b rs2) = an...
Siegel asked 12/7, 2013 at 12:39

2

Solved

I'm learning the ropes of QuickCheck >= 2.6 but I don't understand what a shrink is. From looking at the type signature shrink looks more like expand! Please illuminate me :)
Eboh asked 6/6, 2013 at 17:33

2

Solved

I have a simple type definition: data Cell = Cell { x :: Int, y :: Int } deriving (Show) I can't use Cell as an input to a quickcheck property, presumably because quickcheck doesn't know how ...
Generalization asked 8/5, 2013 at 12:3

3

Solved

I wrote an implementation for foldl and wanted to check if it worked, I tried some cases and it seems to be working well but I want to make sure. I read about quickCheck and tried it, but I can't ...
F asked 24/4, 2013 at 20:40

1

Solved

I am using QuickCheck-2.5.1.1 to do QA. I am testing two pure functions gold :: a -> Float and f :: a -> Float, where a instances Arbitrary. Here gold is a reference calculation and f is a ...
Emmaemmalee asked 12/3, 2013 at 14:51

© 2022 - 2024 — McMap. All rights reserved.