X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftimer.impure.lisp;h=a2028b8aaa55a2f0deccba799d7281a55f96634a;hb=c7c7bab2b37d8b9fbda8f955f09540db17573afa;hp=220c6595cceadb09a3933aa3ee0e6038398894e2;hpb=b3907e261afc6af9954b8232b662e04f519f8158;p=sbcl.git diff --git a/tests/timer.impure.lisp b/tests/timer.impure.lisp index 220c659..a2028b8 100644 --- a/tests/timer.impure.lisp +++ b/tests/timer.impure.lisp @@ -140,3 +140,24 @@ (assert t)))) (sleep 6) (assert t)) + + +(defun random-type (n) + `(integer ,(random n) ,(+ n (random n)))) + +;;; FIXME: Since timeouts do not work on Windows this would loop +;;; forever. +#-win32 +(with-test (:name '(:hash-cache :interrupt)) + (let* ((type1 (random-type 500)) + (type2 (random-type 500)) + (wanted (subtypep type1 type2))) + (dotimes (i 100) + (block foo + (sb-ext:schedule-timer (sb-ext:make-timer + (lambda () + (assert (eq wanted (subtypep type1 type2))) + (return-from foo))) + 0.05) + (loop + (assert (eq wanted (subtypep type1 type2))))))))