(define-test-module (test module sph random-data) (import (sph list) (sph random-data)) (define-test (random-list arguments) (list-bind arguments (len max min) (let (r (apply random-list arguments)) (if (and (= (length r) len) (every (l (e) (and (integer? e) (<= e max) (>= e min))) r)) #t r)))) (define-test (random arguments) (list-bind arguments (max min) (let (r (map-integers 300 (l (n) (random max min)))) (every (l (e) (and (integer? e) (>= e min) (<= e max))) r)))) (define-test (random-3 arguments) (list-bind arguments (max min) (let* ( (r (map-integers 300 (l (n) (random max min)))) (r-2 (every (l (e) (and (integer? e) (>= e min) (<= e max))) r))) (if r-2 #t (list r-2 r))))) (define-test (random-string arguments) (let (r (apply random-string arguments)) (if r #t r))) (test-execute-procedures-lambda (random-list (200 255 0) #t) (random (2 1) #t (6 3) #t (3000 300) #t) (random-string () #t)))