tests: add a new test suite "stream"

Currently it contains only a check for a recently fixed bug in:
streams: fix a braino in str_in_unread_char
This commit is contained in:
Daniel Kochmański 2025-07-23 15:50:12 +02:00
parent a916a5ccff
commit a887d040a2
2 changed files with 21 additions and 0 deletions

View file

@ -28,6 +28,7 @@
(:file "external-formats" :if-feature :unicode)
(:file "unicode" :if-feature :unicode)
(:file "complex")
(:file "stream")
(:file "wscl")))
(:module stress-tests
:default-component-class asdf:cl-source-file.lsp

View file

@ -0,0 +1,20 @@
;;;; -*- Mode: Lisp; Syntax: Common-Lisp; indent-tabs-mode: nil -*-
;;;; vim: set filetype=lisp tabstop=8 shiftwidth=2 expandtab:
;;;; Author: Daniel Kochmański
;;;; Created: 2025-07-22
;;;; Contains: Stream tests (for encodings see the suite "eformat")
(in-package #:cl-test)
(suite 'stream)
(deftest stream.unread-signals-error ()
(let ((stream (make-string-input-stream "jd")))
(signals error (unread-char #\x stream))
(is (char= #\j (read-char stream)))
(is (char= #\d (read-char stream)))
(finishes (unread-char #\d stream))
(is (char= #\d (read-char stream)))
(is (eql (read-char stream) :eof))))