-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest.lisp
32 lines (26 loc) · 1.4 KB
/
test.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;;; This file is automatically generated from file `literate-lisp.org'.
;;; Please read file `literate-lisp.org' to find out the usage and implementation detail of this source file.
(in-package #:literate-lisp)
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (find-package :fiveam)
#+quicklisp (ql:quickload :fiveam)
#-quicklisp (asdf:load-system :fiveam)))
(5am:def-suite literate-lisp-suite :description "The test suite of literate-lisp.")
(5am:in-suite literate-lisp-suite)
(5am:test read-keywords-from-string
(5am:is (equal nil (read-keywords-from-string "")))
(5am:is (equal '(:load :no) (read-keywords-from-string " :load no ")))
(5am:is (equal '(:load (:no . :not)) (read-keywords-from-string " :load -no ")))
(5am:is (equal '(:load :no) (read-keywords-from-string " :load no"))))
(5am:test protect-tangled-file
(5am:signals (error "The form ~S is expected to signal an ~S"
'(error "an error") 'error)
(let* ((org-file (format nil "~a/readme.org"
(asdf:component-pathname (asdf:find-system :literate-lisp))))
(lisp-file (make-pathname :defaults org-file :type "lisp")))
(tangle-org-file org-file)
(with-open-file (stream lisp-file :direction :output)
(write-line ";; Update lisp file outside." stream))
(tangle-org-file org-file))))
(defun run-test ()
(5am:run! 'literate-lisp-suite))