a test for PR 14369
This commit is contained in:
parent
381bdfb32a
commit
5475dcaaf9
20
pkgs/htdp-pkgs/htdp-test/2htdp/tests/random-seed-works.rkt
Normal file
20
pkgs/htdp-pkgs/htdp-test/2htdp/tests/random-seed-works.rkt
Normal file
|
@ -0,0 +1,20 @@
|
|||
#lang racket
|
||||
|
||||
(require 2htdp/universe 2htdp/image rackunit)
|
||||
|
||||
(define (main)
|
||||
(random-seed 1324)
|
||||
(big-bang
|
||||
'()
|
||||
#;
|
||||
(on-tick (λ (l) (cons (random 100) l)) 1/100 30)
|
||||
;; it fails mostly with just time but not always, strange
|
||||
|
||||
(to-draw (λ (l)
|
||||
(text (if (> (length l) 3) "ok" (~a "press a again: " (- 2 (length l)))) 222 *color)))
|
||||
(on-key (λ (l ke)
|
||||
(if (and (key=? "a" ke) (<= (length l) 3)) (cons (random 100) l) l)))
|
||||
(stop-when (λ (l) (>= (length l) 2)))))
|
||||
(define *color 'blue)
|
||||
|
||||
(check-equal? (main) (begin (set! *color 'red) (main)))
|
Loading…
Reference in New Issue
Block a user