Skip to content

Commit

Permalink
Fix typo in test-file
Browse files Browse the repository at this point in the history
  • Loading branch information
simendsjo committed Apr 8, 2024
1 parent 29a0eaa commit 966670a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 105 deletions.
3 changes: 1 addition & 2 deletions src/doctest.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@
See also the documentation string for test."
(multiple-value-bind (tests-failed tests-passed)
(with-open-file (docstring filename :direction :input)
(test-docstrting docstring :output output :test test))
(test-docstring (uiop:read-file-string filename) :output output :test test)
(print-results filename 'file output tests-failed tests-passed)))

(defun test-package (package &key (output t) (test #'equalp))
Expand Down
103 changes: 0 additions & 103 deletions test-file.tst

This file was deleted.

13 changes: 13 additions & 0 deletions tests/doctest.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,16 @@
(defmacro test-macro () :macro)
(setf (documentation 'test-macro 'function) ">> (sijo-doctest/tests::test-macro) :macro")
(assert-doctest (values 0 1) 'test-macro)))

(define-test doctest-file ()
(multiple-value-bind (file-failed file-passed)
(uiop:with-temporary-file (:pathname 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 966670a

Please sign in to comment.