X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Frandom.lisp;h=bb4ba9eaadcc21d54ec5330c51b221634202c137;hb=f7d91555fd68221917e4323a1f4409011a6084f6;hp=6cf070d3821247de8484940fd7733e3aeae5ff38;hpb=576bc9b8fee8387b173cc728b6e22321c82413ed;p=fiveam.git diff --git a/src/random.lisp b/src/random.lisp index 6cf070d..bb4ba9e 100644 --- a/src/random.lisp +++ b/src/random.lisp @@ -2,7 +2,7 @@ (in-package :it.bese.FiveAM) -;;;; * Random (QuickCheck-ish) testing +;;;; ** Random (QuickCheck-ish) testing ;;;; FiveAM provides the ability to automatically generate a ;;;; collection of random input data for a specific test and run a @@ -104,7 +104,7 @@ returning true. This second run limit prevents that.") (defclass for-all-test-never-run (test-failure for-all-test-result) ()) -;;;; ** Generators. +;;;; *** Generators ;;;; Since this is random testing we need some way of creating random ;;;; data to feed to our code. Generators are regular functions whcih @@ -117,7 +117,7 @@ returning true. This second run limit prevents that.") (lambda () ,@body))) (defgenerator gen-integer (&key (max (1+ most-positive-fixnum)) - (min (1+ most-negative-fixnum))) + (min (1- most-negative-fixnum))) (+ min (random (1+ (- max min))))) (defgenerator gen-character (&key (code (gen-integer :min 0 :max (1- char-code-limit)))