1.0.17.21: LIST-FILL* return value (regression 1.0.12.16)
[sbcl/pkhuong.git] / tests / bivalent-stream.impure.lisp
blobc9107f829ef1a5cf03342afaf0844a942fae60bf
1 ;;;; This file is for testing bivalent stream functionality, using
2 ;;;; test machinery which might have side effects (e.g. executing
3 ;;;; DEFUN, writing files). Note that the tests here might reach into
4 ;;;; unexported functionality, and should not be used as a guide for
5 ;;;; users.
7 ;;;; This software is part of the SBCL system. See the README file for
8 ;;;; more information.
9 ;;;;
10 ;;;; While most of SBCL is derived from the CMU CL system, the test
11 ;;;; files (like this one) were written from scratch after the fork
12 ;;;; from CMU CL.
13 ;;;;
14 ;;;; This software is in the public domain and is provided with
15 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
16 ;;;; more information.
18 ;;; Test character decode restarts.
19 (with-open-file (s "bivalent-stream-test.txt" :direction :output
20 :if-exists :supersede
21 :element-type :default :external-format :utf-8)
22 (write-byte 65 s)
23 (write-char #\B s)
24 (write-byte #xe0 s)
25 (write-char #\C s))
27 (with-open-file (s "bivalent-stream-test.txt" :direction :input
28 :element-type :default
29 :external-format :utf-8)
30 (assert (eql (read-char s nil s) #\A))
31 (assert (eql (read-byte s nil s) 66))
32 (assert (eql (read-byte s nil s) #xe0))
33 (assert (eql (read-char s nil s) #\C)))
35 (delete-file "bivalent-stream-test.txt")