Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Karsten Poeck
ansi-test
Commits
383251b0
Commit
383251b0
authored
Jan 28, 2004
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add minimal tests for stream-external-form, with-open-file.
parent
59469e1e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
2 deletions
+121
-2
ansi-tests/load-streams.lsp
ansi-tests/load-streams.lsp
+1
-1
ansi-tests/open.lsp
ansi-tests/open.lsp
+40
-1
ansi-tests/stream-external-format.lsp
ansi-tests/stream-external-format.lsp
+24
-0
ansi-tests/with-open-file.lsp
ansi-tests/with-open-file.lsp
+56
-0
No files found.
ansi-tests/load-streams.lsp
View file @
383251b0
...
...
@@ -28,4 +28,4 @@
(load "file-position.lsp")
(load "file-string-length.lsp")
(load "open.lsp")
(load "stream-external-format.lsp")
ansi-tests/open.lsp
View file @
383251b0
...
...
@@ -303,7 +303,46 @@
(notnot (every #'eql seq vals))))))
t)
;;; Add -- tests for when the filespec is a stream
;;; FIXME: Add -- tests for when the filespec is a stream
(deftest open.66
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn :direction :io :if-exists :rename-and-delete
:if-does-not-exist :create)
(format s "some stuff~%")
(finish-output s)
(let ((is (open s :direction :input)))
(unwind-protect
(values
(read-char is)
(notnot (file-position s :start))
(read-line is)
(read-line s))
(close is)))))
#\s
t
"ome stuff"
"some stuff")
(deftest open.67
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(let ((s (open pn :direction :output)))
(unwind-protect
(progn
(format s "some stuff~%")
(finish-output s)
(close s)
(let ((is (open s :direction :input)))
(unwind-protect
(values (read-line is))
(close is))))
(when (open-stream-p s) (close s)))))
"some stuff")
;;; FIXME: Add -- tests for when element-type is :default
;;; Tests of file creation
...
...
ansi-tests/stream-external-format.lsp
0 → 100644
View file @
383251b0
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Tue Jan 27 20:53:21 2004
;;;; Contains: Tests of STREAM-EXTERNAL-FORMAT
(in-package :cl-test)
;;; This is tested in open.lsp
;;; Error tests
(deftest stream-external-format.error.1
(signals-error (stream-external-format) program-error)
t)
(deftest stream-external-format.error.2
(signals-error
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn :direction :output :if-exists :supersede)
(stream-external-format s nil)))
program-error)
t)
ansi-tests/with-open-file.lsp
0 → 100644
View file @
383251b0
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Tue Jan 27 20:57:05 2004
;;;; Contains: Tests of WITH-OPEN-FILE
(in-package :cl-test)
;;; For now, omit most of the options combinations, assuming they will
;;; be tested in OPEN. The tests of OPEN should be ported to here at some
;;; point.
(deftest with-open-file.1
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file (s pn :direction :output)))
nil)
(deftest with-open-file.2
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn :direction :output)
(notnot-mv (output-stream-p s))))
t)
(deftest with-open-file.3
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn :direction :output)
(values))))
(deftest with-open-file.4
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn :direction :output)
(values 1 2 3 4 5 6 7 8)))
1 2 3 4 5 6 7 8)
(deftest with-open-file.5
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn :direction :output)
(declare (ignore s))))
nil)
(deftest with-open-file.6
(let ((pn #p"tmp.dat"))
(delete-all-versions pn)
(with-open-file
(s pn (cdr '(nil . :direction)) (car '(:output)))
(format s "foo!~%"))
(with-open-file (s pn) (read-line s)))
"foo!" nil)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment