Commits

Anonymous committed e1ea8a3

removed (gen-* upper) api

  • Participants
  • Parent commits af5fcc2
  • Branches 3.0.0

Comments (0)

Files changed (2)

File data-generators-impl.scm

 (define (gen-for-each rounds proc gen)
   (do ((i 1 (add1 i)))
       ((>= i rounds))
-    (proc (<- gen))))
+    (proc (<- gen) i)))
 
 ;;== generic generator
 ;; convenience procedure to quickly create a generator for a given range that dispatches on
   (cond
    ((range? size-spec)
     (list (range-start size-spec) (range-end size-spec)))
-   ((number? size-spec)
-    (list lower size-spec))
    (else (error "invalid size specification" size-spec))))
 
 (define gen-fixnum

File tests/run.scm

       (test "applies proc amount times"
             3
             (begin
-              (gen-for-each 3 (lambda (value) (set! runs (add1 runs))) (gen-list-of (gen-fixnum)))
+              (gen-for-each 3 (lambda (value idx) (set! runs (add1 runs))) (gen-list-of (gen-fixnum)))
               runs))))
 
 (test-group "<-"
     (test-assert
      (between? (<- (gen-fixnum)) (gen-current-fixnum-min) (gen-current-fixnum-max)))
     (test-assert
-     (between? (<- (gen-fixnum 4)) (gen-current-fixnum-min) 4))
-    (test-assert
      (between? (<- (gen-fixnum 2 4)) 2 4))
     (test-assert
      (between? (<- (gen-fixnum (range 2 4))) 2 4))
            (test-assert
             (between? (<- (gen-even-fixnum)) (gen-current-fixnum-min) (gen-current-fixnum-max)))
            (test-assert
-            (between? (<- (gen-even-fixnum 4)) (gen-current-fixnum-min) 4))
-           (test-assert
             (between? (<- (gen-even-fixnum 2 4)) 2 4))
            (test-assert
             (between? (<- (gen-even-fixnum (range 2 4))) 2 4))
            (test-assert
             (between? (<- (gen-odd-fixnum)) (gen-current-fixnum-min) (gen-current-fixnum-max)))
            (test-assert
-            (between? (<- (gen-odd-fixnum 4)) (gen-current-fixnum-min) 4))
-           (test-assert
             (between? (<- (gen-odd-fixnum 2 4)) 2 4))
            (test-assert
             (between? (<- (gen-odd-fixnum (range 2 4))) 2 4))
     (test-assert
      (between? (<- (gen-real)) 0.0 1.0))
     (test-assert
-     (between? (<- (gen-real 1.0)) 0.0 1.0))
-    (test-assert
      (between? (<- (gen-real 1.0 2.0)) 1.0 2.0))
     (test-assert
-     (between? (<- (gen-real 2.0)) 0.0 2.0))
-    (test-assert
      (between? (<- (gen-real (range 1.0 2.0))) 1.0 2.0))
     (test-error "lower bound <= upper bound"
      (gen-real 2.0 1.0)))