Skip to content

Capturing output by redirecting standard output stream to local stream results in prematurely closed-flame streams #95

Description

@afranson

MWE:

(5am:test foo-bar
  (5am:is (= 5 5))
  (5am:is (string= "
\"print test\" " (with-open-stream (s (make-string-output-stream))
		     (setf *standard-output* s)
		     (print "print test")
		     (get-output-stream-string s)))))

(5am:run! 'foo-bar)

Running the second test case outside the 5am framework results in 'T'. Running as shown above via 5am:run! results in

#<SB-IMPL::STRING-OUTPUT-STREAM {101B27A743}> is closed
   [Condition of type SB-INT:CLOSED-STREAM-ERROR]

with

(IT.BESE.FIVEAM::ADD-RESULT IT.BESE.FIVEAM::UNEXPECTED-TEST-FAILURE :TEST-EXPR NIL :TEST-CASE #<IT.BESE.FIVEAM::TEST-CASE FOO-BAR {101B068893}> :REASON "Unexpected Error: #<SB-INT:CLOSED-STREAM-ERROR ..

and

((FLET "H1" :IN IT.BESE.FIVEAM::RUN-TEST-LAMBDA) #<SB-INT:CLOSED-STREAM-ERROR {101B27A8D3}>)

further down.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions