X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fgcd.pure.lisp;h=08bc34b0706f4bf659fcaae0c106ed5f9b21f997;hb=9c9d6dbdc28a8bfe70be09f35263e9ec02411d0e;hp=ae66887867448b7d16643ddb628526f6303aac2a;hpb=b5dc433da5b8bd3b36db88f7ec35cdb03cb64384;p=sbcl.git diff --git a/tests/gcd.pure.lisp b/tests/gcd.pure.lisp index ae66887..08bc34b 100644 --- a/tests/gcd.pure.lisp +++ b/tests/gcd.pure.lisp @@ -6,7 +6,7 @@ ;;;; While most of SBCL is derived from the CMU CL system, the test ;;;; files (like this one) were written from scratch after the fork ;;;; from CMU CL. -;;;; +;;;; ;;;; This software is in the public domain and is provided with ;;;; absolutely no warranty. See the COPYING and CREDITS files for ;;;; more information. @@ -20,22 +20,22 @@ (defun random-factor (n) (let ((accum 1)) (dotimes (i n accum) - (setf accum (* accum (nth (random 20) - '(2 2 2 3 3 - 5 7 11 13 17 - 19 23 29 31 37 - 41 43 47 53 59))))))) - + (setf accum (* accum (nth (random 20) + '(2 2 2 3 3 + 5 7 11 13 17 + 19 23 29 31 37 + 41 43 47 53 59))))))) + (with-open-file (s "tests/gcd.impure.lisp" - :direction :output :if-exists :supersede) + :direction :output :if-exists :supersede) (dotimes (i 40) (dotimes (j (ceiling i 2)) - (let ((x (random-factor i)) - (y (random-factor j))) - (format s "~&~S~%" `(assert (= (gcd ,x ,y) ,(gcd x y))))))))) + (let ((x (random-factor i)) + (y (random-factor j))) + (format s "~&~S~%" `(assert (= (gcd ,x ,y) ,(gcd x y))))))))) ;;; run from a different lisp implementation. As such, if you get a ;;; failure, check (by hand!) who is right. -- CSR, 2004-08-10 - + (ASSERT (= (GCD 3 1) 1)) (ASSERT (= (GCD 9 1) 1)) (ASSERT (= (GCD 1353 1) 1))