Skip to content

Commit

Permalink
test-file
Browse files Browse the repository at this point in the history
  • Loading branch information
simendsjo committed Apr 8, 2024
1 parent cf983cf commit 2700c14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/doctest.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@
(define-test doctest-file ()
(multiple-value-bind (file-failed file-passed)
(uiop:with-temporary-file (:pathname test-file)
(with-open-file (stream test-file :direction :output)
(format stream (documentation doctest:test 'function))
(finish-output stream))
(doctest:test test-file))
(unwind-protect (progn
(uiop:delete-file-if-exists test-file)
(with-open-file (stream test-file :direction :output :external-format :utf-8)
(write-string (documentation #'doctest:test 'function) stream))
(doctest:test test-file))
(uiop:delete-file-if-exists test-file)))
(multiple-value-bind (doctest-failed doctest-passed) (doctest:test #'doctest:test)
(assert-eql doctest-failed file-failed)
(assert-eql doctest-passed file-passed))))

0 comments on commit 2700c14

Please sign in to comment.