Bogdanp / rackcheck

A property-based testing library for Racket.
28 stars 7 forks source link

A Potential Bug in the usage of Random Function #14

Closed alpaylan closed 4 months ago

alpaylan commented 4 months ago

It might be my my fault somehow, but when I'm running a property I sometimes get

random: difference between first and second arguments is greater than 4294967087

as the error. My generators are rather naive and simple, that's why I thought it might be a bug with the library.

(define gen:kv (gen:tuple gen:natural gen:natural))

(define gen:kvlist (gen:list gen:kv))

(define bespoke
    (gen:let ([kvs gen:kvlist])
        (foldl insert_correct (E) kvs))       
)

Where insert_correct inserts a key-value pair to a binary search tree.

Is there any way I can provide you with more information? (the debug traces in Racket did not seem to help too much) How can I resolve this problem?

Bogdanp commented 4 months ago

Thanks for the report! The latest commit should fix this problem.