quickcheck

Property-based testing for Kit inspired by QuickCheck

Files

FileDescription
kit.tomlPackage manifest with metadata and dependencies
src/main.kitGenerators, property checking, and shrinking functions
tests/quickcheck.test.kitTests for generators, combinators, and property validation
examples/basic.kitProperty testing for list and arithmetic laws
LICENSEMIT license file

Dependencies

No Kit package dependencies.

Installation

kit add gitlab.com/kit-lang/packages/kit-quickcheck.git

Usage

import Kit.Quickcheck

License

MIT License - see LICENSE for details.

Exported Functions & Types

gen-int

Int -> Int

gen-int-range

Int -> Int -> Int -> Int

gen-nat

Int -> Int

gen-bool?

Int -> Bool

gen-float

Int -> Float

gen-float-range

Float -> Float -> Int -> Float

gen-char

Int -> Char

gen-alpha-num

Int -> String

gen-lower

Int -> Char

gen-upper

Int -> Char

gen-string

Int -> String

gen-alpha-num-string

Int -> String

gen-list

(Int -> a) -> Int -> [a]

gen-non-empty-list

(Int -> a) -> Int -> [a]

gen-list-of-length

Int -> (Int -> a) -> Int -> [a]

gen-option

(Int -> a) -> Int -> Option a

gen-tuple2

(Int -> a) -> (Int -> b) -> Int -> (a, b)

gen-tuple3

(Int -> a) -> (Int -> b) -> (Int -> c) -> Int -> (a, b, c)

gen-one-of

[(Int -> a)] -> Int -> a

gen-frequency

[(Int, Int -> a)] -> Int -> a

gen-const

a -> Int -> a

gen-map

(a -> b) -> (Int -> a) -> Int -> b

gen-such-that

(a -> Bool) -> (Int -> a) -> Int -> a

sample

(Int -> a) -> a

sample-sized

Int -> (Int -> a) -> a

samples

(Int -> a) -> Int -> [a]

check

String -> (Int -> a) -> (a -> Bool) -> Result Int {tests: Int, value: a}

check-n

String -> Int -> (Int -> a) -> (a -> Bool) -> Result Int {tests: Int, value: a}

check-all

[(String, ((Int -> a), a -> Bool))] -> Result Int Int

shrink-int

Int -> [Int]

shrink-list

[a] -> [[a]]

shrink-str

String -> [String]