From 53bfdda42de6d4f464546cdba1456262d4065ee7 Mon Sep 17 00:00:00 2001 From: Raymond Toy <toy.raymond@gmail.com> Date: Sat, 9 Aug 2014 22:15:07 -0700 Subject: [PATCH] Add test for ticket:101 for the case of CLEAR-OUTPUT of a lisp stream. --- tests/trac.lisp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/trac.lisp b/tests/trac.lisp index 571b0691d..8253bc2e8 100644 --- a/tests/trac.lisp +++ b/tests/trac.lisp @@ -367,6 +367,36 @@ (assert-error 'reader-error (read-from-string "1d-324")) (assert-error 'reader-error (read-from-string "1w-324"))) +(defparameter *test-path* + (merge-pathnames (make-pathname :name :unspecific :type :unspecific + :version :unspecific) + *load-truename*) + "Directory for temporary test files.") + +(defparameter *test-file* + (merge-pathnames #p"test-data.tmp" *test-path*)) + + +;; Not quite what ticket 101 is about, but it came up in investigating +;; CLEAR-OUTPUT on a Gray stream. Verify CLEAR-OUTPUT actually +;; does. Previously, it did nothing. +(define-test trac.101 + (:tag :trac) + (assert-eql + 0 + (let ((s (open *test-file* + :direction :output + :if-exists :supersede))) + (unwind-protect + (progn + (write-char #\a s) + (clear-output s) + (close s) + (setf s (open *test-file*)) + (file-length s)) + (close s) + (delete-file *test-file*))))) + (defun read-string-fn (str) (handler-case (let ((acc nil)) -- GitLab