Commit 8dc7806a authored by pfdietz's avatar pfdietz

Begin adding tests for read-sequence.lsp

parent eb2661e9
......@@ -22,3 +22,4 @@
(load "read-line.lsp")
(load "write-string.lsp")
(load "write-line.lsp")
(load "read-sequence.lsp")
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Mon Jan 19 06:55:04 2004
;;;; Contains: Tests of READ-SEQUENCE
(in-package :cl-test)
(deftest read-sequence.1
(let ((s (make-string 5)))
(with-input-from-string
(is "abcdefghijk")
(values
(read-sequence s is)
s)))
5
"abcde")
(deftest read-sequence.2
(let ((s (make-string 5 :initial-element #\Space)))
(with-input-from-string
(is "abc")
(values
(read-sequence s is)
s)))
3
"abc ")
(deftest read-sequence.3
(let ((s (make-string 5 :initial-element #\Space)))
(with-input-from-string
(is "abcdefghijk")
(values
(read-sequence s is :start 1)
s)))
5
" abcd")
(deftest read-sequence.4
(let ((s (make-string 5 :initial-element #\Space)))
(with-input-from-string
(is "abcdefghijk")
(values
(read-sequence s is :end 3)
s)))
3
"abc ")
(deftest read-sequence.5
(let ((s (make-string 5 :initial-element #\Space)))
(with-input-from-string
(is "abcdefghijk")
(values
(read-sequence s is :start 1 :end 4)
s)))
4
" abc ")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment