Happy !

zeroflag / QuickCheck

Project infos

License MIT
Tags
Creation date 2013-11-10
Website

Monticello registration

About QuickCheck

Pharo QuickCheck

A simple and extensible implementation of the property-based testing tool called QuickCheck for Pharo Smalltalk.

Syntax

For all: Generator(s) where: optionalFilterBlock check: assertBlock samples: optionalNumberOfSamples

Examples

Single generator:

For all: PositiveIntegers check: [:int | self assert: (int * int) sqrt equals: int]

Using multiple generators:

For 
    all: (Collections of: Integers), (Collections of: Integers) 
    check: [:a :b | self assert: (a, b) size equals: a size + b size].

Filtering:

For 
    all: Integers, Integers 
    where: [:lt :gt | lt < gt] 
    check: [:lt :gt | self assert: (gt - lt) positive]