From a423fbe7a2ff8a65deed8d6731047842d9d006ae Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Wed, 21 Jul 2004 03:25:25 +0000 Subject: [PATCH] Added tests for print-tab, write. --- ansi-tests/print-tab.lsp | 10 +++++ ansi-tests/write.lsp | 87 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 ansi-tests/print-tab.lsp create mode 100644 ansi-tests/write.lsp diff --git a/ansi-tests/print-tab.lsp b/ansi-tests/print-tab.lsp new file mode 100644 index 00000000..286bac25 --- /dev/null +++ b/ansi-tests/print-tab.lsp @@ -0,0 +1,10 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Sat Jul 10 14:08:08 2004 +;;;; Contains: Tests of PRINT-TAB + +(in-package :cl-test) + +(compile-and-load "printer-aux.lsp") + + diff --git a/ansi-tests/write.lsp b/ansi-tests/write.lsp new file mode 100644 index 00000000..c3b5c896 --- /dev/null +++ b/ansi-tests/write.lsp @@ -0,0 +1,87 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Thu Jul 15 06:43:55 2004 +;;;; Contains: Tests of WRITE + +(in-package :cl-test) + +(compile-and-load "printer-aux.lsp") +;; (compile-and-load "write-aux.lsp") + +;;; This function is also incidentally tested elsewhere. + +(deftest write.1 + (random-write-test 1000) + nil) + +(deftest write.2 + (with-standard-io-syntax + (with-output-to-string + (*standard-output*) + (write 2 :stream nil))) + "2") + +(deftest write.3 + (with-standard-io-syntax + (with-output-to-string + (os) + (with-input-from-string + (is "") + (with-open-stream (*terminal-io* (make-two-way-stream is os)) + (write 3 :stream t))))) + "3") + +(deftest write.4 + (with-standard-io-syntax + (with-output-to-string + (os) + (write 4 :stream os))) + "4") + +(deftest write.5 + (with-standard-io-syntax + (with-output-to-string + (*standard-output*) + (write 5 :allow-other-keys nil))) + "5") + +(deftest write.6 + (with-standard-io-syntax + (with-output-to-string + (*standard-output*) + (write 6 :allow-other-keys t :foo 'bar))) + "6") + +(deftest write.7 + (with-standard-io-syntax + (with-output-to-string + (*standard-output*) + (write 7 :base 10 :base 3))) + "7") + +;;; Error tests + +(deftest write.error.1 + (signals-error (write) program-error) + t) + +(deftest write.error.2 + (signals-error (write 1 :stream) program-error) + t) + +(deftest write.error.3 + (signals-error (write 1 :allow-other-keys nil :foo 'bar) program-error) + t) + +(deftest write.error.4 + (signals-error (write 1 :allow-other-keys nil :allow-other-keys t :foo 'bar) program-error) + t) + + + + + + + + + -- GitLab