Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
33a91f6a
Commit
33a91f6a
authored
10 years ago
by
Raymond Toy
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for CLEAR-OUTPUT.
parent
b6373368
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/fd-streams.lisp
+36
-0
36 additions, 0 deletions
tests/fd-streams.lisp
tests/gray-streams.lisp
+39
-0
39 additions, 0 deletions
tests/gray-streams.lisp
with
75 additions
and
0 deletions
tests/fd-streams.lisp
0 → 100644
+
36
−
0
View file @
33a91f6a
;;;; -*- Lisp -*-
(
defpackage
fd-streams-tests
(
:use
#:common-lisp
#:lisp-unit
))
(
in-package
#:fd-streams-tests
)
(
defparameter
*test-path*
(
merge-pathnames
(
make-pathname
:name
:unspecific
:type
:unspecific
:version
:unspecific
)
*load-truename*
)
"Directory for temporary test files."
)
(
defparameter
*test-file*
(
merge-pathnames
#p"test-data.tmp"
*test-path*
))
(
eval-when
(
:load-toplevel
)
(
ensure-directories-exist
*test-path*
:verbose
t
))
(
define-test
clear-output-1
(
:tag
:trac
)
(
assert-eql
0
(
unwind-protect
(
let
((
s
(
open
*test-file*
:direction
:output
:if-exists
:supersede
)))
;; Write a character to the (fully buffered) output
;; stream. Clear the output and close the file. Nothing
;; should have been written to the file.
(
write-char
#\a
s
)
(
clear-output
s
)
(
close
s
)
(
setf
s
(
open
*test-file*
))
(
file-length
s
))
(
delete-file
*test-file*
))))
This diff is collapsed.
Click to expand it.
tests/gray-streams.lisp
0 → 100644
+
39
−
0
View file @
33a91f6a
;;;; -*- Lisp -*-
(
require
:gray-streams
)
(
defpackage
gray-streams-tests
(
:use
#:common-lisp
#:lisp-unit
))
(
in-package
#:gray-streams-tests
)
(
defparameter
*test-path*
(
merge-pathnames
(
make-pathname
:name
:unspecific
:type
:unspecific
:version
:unspecific
)
*load-truename*
)
"Directory for temporary test files."
)
(
defparameter
*test-file*
(
merge-pathnames
#p"test-data.tmp"
*test-path*
))
(
eval-when
(
:load-toplevel
)
(
ensure-directories-exist
*test-path*
:verbose
t
))
(
define-test
clear-output-1
(
:tag
:trac
)
;; Create a Gray stream and make sure that clear-output works.
(
assert-eql
0
(
unwind-protect
(
let
((
s
(
open
*test-file*
:direction
:output
:if-exists
:supersede
:class
'lisp::character-output-stream
)))
(
write-char
#\a
s
)
(
clear-output
s
)
(
close
s
)
(
setf
s
(
open
*test-file*
))
(
file-length
s
))
(
delete-file
*test-file*
))))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment