summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>1999-08-18 20:33:18 +0000
committerGary Houston <ghouston@arglist.com>1999-08-18 20:33:18 +0000
commit7f214e606655b3f18f4cdb21ae9f94b4e545bdc5 (patch)
tree3d930af46f5280f233a4e2f0f710056e1dc79abd /test-suite
parent7a2230a052a3db384718f88edacb10cbbab1bf9b (diff)
downloadguile-7f214e606655b3f18f4cdb21ae9f94b4e545bdc5.tar.gz
1999-08-18 Gary Houston <ghouston@easynet.co.uk>
* tests/ports.test: tests for NUL and non-ASCII chars to fports.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/ChangeLog4
-rw-r--r--test-suite/tests/ports.test21
2 files changed, 25 insertions, 0 deletions
diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog
index 6dd33904f..b1ad88658 100644
--- a/test-suite/ChangeLog
+++ b/test-suite/ChangeLog
@@ -1,3 +1,7 @@
+1999-08-18 Gary Houston <ghouston@easynet.co.uk>
+
+ * tests/ports.test: tests for NUL and non-ASCII chars to fports.
+
1999-08-12 Gary Houston <ghouston@easynet.co.uk>
* tests/ports.test: lseek -> seek.
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
index b5034f949..88153ec49 100644
--- a/test-suite/tests/ports.test
+++ b/test-suite/tests/ports.test
@@ -115,6 +115,27 @@
(char=? (read-char port) #\s))
(delete-file filename)))
+;;; unusual characters.
+(catch-test-errors
+ (let* ((filename (test-file))
+ (port (open-output-file filename)))
+ (display (string #\nul (integer->char 255) (integer->char 128)
+ #\nul) port)
+ (close-port port)
+ (let* ((port (open-input-file filename))
+ (line (read-line port)))
+ (pass-if "file: read back NUL 1"
+ (char=? (string-ref line 0) #\nul))
+ (pass-if "file: read back 255"
+ (char=? (string-ref line 1) (integer->char 255)))
+ (pass-if "file: read back 128"
+ (char=? (string-ref line 2) (integer->char 128)))
+ (pass-if "file: read back NUL 2"
+ (char=? (string-ref line 3) #\nul))
+ (pass-if "file: EOF"
+ (eof-object? (read-char port))))
+ (delete-file filename)))
+
;;;; Pipe ports.