From d67d870b13d763e9a1fc355442b3c3d426fa4a87 Mon Sep 17 00:00:00 2001
From: pfdietz <pfdietz@localhost>
Date: Fri, 30 Jan 2004 13:38:19 +0000
Subject: [PATCH] Fixed up broadcast stream tests so more, adding tests for
 behavior on null broadcast streams.

---
 ansi-tests/make-broadcast-stream.lsp | 36 +++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/ansi-tests/make-broadcast-stream.lsp b/ansi-tests/make-broadcast-stream.lsp
index 663b1292..73767ead 100644
--- a/ansi-tests/make-broadcast-stream.lsp
+++ b/ansi-tests/make-broadcast-stream.lsp
@@ -10,10 +10,10 @@
     (assert (typep s 'stream))
     (assert (typep s 'broadcast-stream))
     (assert (output-stream-p s))
-    (assert (not (input-stream-p s)))
+    ;; (assert (not (input-stream-p s)))
     (assert (open-stream-p s))
     (assert (streamp s))
-    (assert (stream-element-type s))
+    (assert (eq (stream-element-type s) t))
     (values
      (notnot (typep s 'stream))
      (notnot (typep s 'broadcast-stream))
@@ -29,10 +29,11 @@
       (assert (typep s 'stream))
       (assert (typep s 'broadcast-stream))
       (assert (output-stream-p s))
-      (assert (not (input-stream-p s)))
+      ;; (assert (not (input-stream-p s)))
       (assert (open-stream-p s))
       (assert (streamp s))
-      (assert (stream-element-type s))
+      (assert (eql (stream-element-type s)
+		   (stream-element-type s1)))
       (write-char #\x s)))
   "x")
 
@@ -43,10 +44,11 @@
       (assert (typep s 'stream))
       (assert (typep s 'broadcast-stream))
       (assert (output-stream-p s))
-      (assert (not (input-stream-p s)))
+      ;; (assert (not (input-stream-p s)))
       (assert (open-stream-p s))
       (assert (streamp s))
-      (assert (stream-element-type s))
+      (assert (eql (stream-element-type s)
+		   (stream-element-type s2)))
       (format s "This is a test"))
     (values
      (get-output-stream-string s1)
@@ -54,6 +56,28 @@
   "This is a test"
   "This is a test")
 
+(deftest make-broadcast-stream.4
+  (fresh-line (make-broadcast-stream))
+  nil)
+
+(deftest make-broadcast-stream.5
+  (file-length (make-broadcast-stream))
+  0)
+
+(deftest make-broadcast-stream.6
+  (file-position (make-broadcast-stream))
+  0)
+
+(deftest make-broadcast-stream.7
+  (file-string-length (make-broadcast-stream) "antidisestablishmentarianism")
+  1)
+
+(deftest make-broadcast-stream.8
+  (stream-external-format (make-broadcast-stream))
+  :default)
+
+
+
 ;;; FIXME
 ;;; Add tests for: close,
 ;;;  peek-char, read-char-no-hang, terpri, fresh-line, unread-char,
-- 
GitLab