[git] CMU Common Lisp branch master updated. snapshot-2013-12-a-31-ge48e7e8
Raymond Toy
rtoy at common-lisp.net
Sun Dec 22 17:04:28 UTC 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, master has been updated
via e48e7e828f77e7013ebf7a7e87ef8055543fc423 (commit)
via 14783bb3f300f44ee99e185b4fbfb78a53296833 (commit)
from d0aaa33ba7afbd83575e1cb9e23832c3a563ca6d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e48e7e828f77e7013ebf7a7e87ef8055543fc423
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sat Dec 21 22:10:59 2013 -0800
Fix trac.50 to use princ-to-string.
diff --git a/tests/trac.lisp b/tests/trac.lisp
index 1fd0683..dbe8741 100644
--- a/tests/trac.lisp
+++ b/tests/trac.lisp
@@ -59,7 +59,7 @@
(define-test trac.50
(:tag :trac)
(assert-equal "#P(:DIRECTORY (:ABSOLUTE \"tmp\" \"\" \"a\" \"\" \"b\"))"
- (princ (make-pathname :directory '(:absolute "tmp" "" "a" "" "b")))))
+ (princ-to-string (make-pathname :directory '(:absolute "tmp" "" "a" "" "b")))))
(defparameter *trac.70* (make-string 40 :initial-element #\A))
commit 14783bb3f300f44ee99e185b4fbfb78a53296833
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sat Dec 21 22:08:12 2013 -0800
Add some selected tests from trac bug reports.
diff --git a/tests/trac.lisp b/tests/trac.lisp
new file mode 100644
index 0000000..1fd0683
--- /dev/null
+++ b/tests/trac.lisp
@@ -0,0 +1,84 @@
+;;; Tests from trac tickets
+
+(defpackage :trac-tests
+ (:use :cl :lisp-unit))
+
+(in-package "TRAC-TESTS")
+
+(define-test trac.1
+ (:tag :trac)
+ (assert-false
+ (let (failures)
+ (dotimes (k 1000)
+ (let ((x (random 1d-3)))
+ (let ((s (prin1-to-string x))
+ (f (format nil "~E" x)))
+ (unless (string-equal s f)
+ (push (list x s f)
+ failures)))))
+ failures)))
+
+(define-test trac.8
+ (:tag :trac)
+ (assert-false
+ (let (failures)
+ (dolist (base (list nil 2 2.0 2d0
+ (ash 1 99) (ash 1 3000)
+ 8/7 (/ (ash 1 3000) 7)))
+ (dolist (number (list 100 100.0 100d0
+ (ash 1 100) (ash 1 3500)
+ 50/7 (/ (ash 1 3500) 7)))
+ (multiple-value-bind (result cond)
+ (ignore-errors (if base
+ (log number base)
+ (log number)))
+ (unless result
+ (push (list number base cond)
+ failures)))))
+ failures)))
+
+(define-test trac.10
+ (:tag :trac)
+ (assert-equal '(536870912 0.5d0)
+ (multiple-value-list (round (+ 536870911 1.5d0)))))
+
+(define-test trac.11
+ (:tag :trac)
+ (assert-true (eql 0w0 0w0)))
+
+(define-test trac.12
+ (:tag :trac)
+ (assert-equal " 0.1D-05"
+ (format nil "~10,1,2,0,'*,,'DE" 1d-6)))
+
+(define-test trac.13
+ (:tag :trac)
+ (assert-equal " 0.100E+01"
+ (format nil "~11,3,2,0,'*,,'EE" .9999)))
+
+(define-test trac.50
+ (:tag :trac)
+ (assert-equal "#P(:DIRECTORY (:ABSOLUTE \"tmp\" \"\" \"a\" \"\" \"b\"))"
+ (princ (make-pathname :directory '(:absolute "tmp" "" "a" "" "b")))))
+
+(defparameter *trac.70* (make-string 40 :initial-element #\A))
+
+(compile 'trac.70-test
+ (lambda (workspace s)
+ (declare (simple-string workspace s))
+ (replace workspace s :start1 1 :end1 5 :start2 1 :end2 5)))
+
+(define-test trac.76
+ (:tag :trac)
+ (assert-equal "A1234AAAA"
+ (subseq (trac.70-test *trac.70* "a12345") 0 9)))
+
+(define-test trac.80
+ (:tag :trac)
+ ;; The following formats should not signal an error.
+ (assert-true (ignore-errors (format nil "~ve" 21 5d-234)))
+ (assert-true (ignore-errors (format nil "~ve" 100 5d-234))))
+
+
+
+
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
tests/trac.lisp | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 tests/trac.lisp
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-cvs
mailing list