From 1c5a201bebe2bfb4f0414d95af8f48c4ef86b60b Mon Sep 17 00:00:00 2001
From: pfdietz <pfdietz@localhost>
Date: Sat, 14 Feb 2004 15:57:43 +0000
Subject: [PATCH] Finish concatenated stream tests, and add tests of
 get-output-stream-string

---
 ansi-tests/TODO                         |  2 ++
 ansi-tests/get-output-stream-string.lsp | 32 +++++++++++++++++++++++++
 ansi-tests/load-streams.lsp             |  3 ++-
 ansi-tests/make-concatenated-stream.lsp | 10 ++++++++
 4 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 ansi-tests/get-output-stream-string.lsp

diff --git a/ansi-tests/TODO b/ansi-tests/TODO
index 50c6c530..26fb54b9 100644
--- a/ansi-tests/TODO
+++ b/ansi-tests/TODO
@@ -23,3 +23,5 @@ Things to do to the test suite (not a complete list)
 
 11. Address issues with broadcast streams (C. Rhodes) -- apparent
    contradictions in the spec.
+
+12. Make sure all string operators work on displaced character vectors.
\ No newline at end of file
diff --git a/ansi-tests/get-output-stream-string.lsp b/ansi-tests/get-output-stream-string.lsp
new file mode 100644
index 00000000..7fc390c7
--- /dev/null
+++ b/ansi-tests/get-output-stream-string.lsp
@@ -0,0 +1,32 @@
+;-*- Mode:     Lisp -*-
+;;;; Author:   Paul Dietz
+;;;; Created:  Sat Feb 14 09:48:46 2004
+;;;; Contains: Tests of GET-OUTPUT-STREAM-STRING
+
+(in-package :cl-test)
+
+;; this function is used extensively elsewhere in the test suite
+
+(deftest get-output-stream-string.1
+  (let ((s (make-string-output-stream)))
+    (values
+     (get-output-stream-string s)
+     (write-string "abc" s)
+     (write-string "def" s)
+     (get-output-stream-string s)
+     (get-output-stream-string s)))
+  "" "abc" "def" "abcdef" "")
+
+;;; Error cases
+
+(deftest get-output-stream-string.error.1
+  (signals-error (get-output-stream-string) t)
+  t)
+
+(deftest get-output-stream-string.error.2
+  (signals-error (get-output-stream-string (make-string-output-stream) nil) t)
+  t)
+
+
+
+     
diff --git a/ansi-tests/load-streams.lsp b/ansi-tests/load-streams.lsp
index becaf532..c8d2952d 100644
--- a/ansi-tests/load-streams.lsp
+++ b/ansi-tests/load-streams.lsp
@@ -46,4 +46,5 @@
 (load "echo-stream-output-stream.lsp")
 (load "make-echo-stream.lsp")
 (load "concatenated-stream-streams.lsp")
-(load "make-concatenated-stream.lsp")
\ No newline at end of file
+(load "make-concatenated-stream.lsp")
+(load "get-output-stream-string.lsp")
diff --git a/ansi-tests/make-concatenated-stream.lsp b/ansi-tests/make-concatenated-stream.lsp
index 85caac8a..02f68d36 100644
--- a/ansi-tests/make-concatenated-stream.lsp
+++ b/ansi-tests/make-concatenated-stream.lsp
@@ -295,6 +295,16 @@
       (listen s))))
   nil)
 
+(deftest make-concatenated-stream.32
+  (clear-input (make-concatenated-stream))
+  nil)
+
+(deftest make-concatenated-stream.33
+  (with-input-from-string
+   (s1 "abc")
+   (clear-input (make-concatenated-stream s1)))
+  nil)
+
 ;;; Error cases
 
 (deftest make-concatenated-stream.error.1
-- 
GitLab