Recently Written · git

coleslaw

Emacs mode for the "Coleslaw" site generator written in Common Lisp.

git clone https://github.com/equwal/coleslaw

Log | Files | Refs


commit 0e325ee56ea3ab449dcd3fad485303abe2c442cd
Masataro Asai <guicho2.71828@gmail.com>
2019-10-26 19:13:50 -0400

testing repl

 cli/cli.lisp      |  3 ++-
 coleslaw-test.asd |  5 +++--
 tests/cli.lisp    | 23 +++++++++++++++++++++++
 3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/cli/cli.lisp b/cli/cli.lisp
index d0d4aef..b148beb 100644
--- a/cli/cli.lisp
+++ b/cli/cli.lisp
@@ -113,7 +113,8 @@ Excerpt separator is `<!--more-->` by default.
                    (string= type "page") name
                    sep)
            (format *error-output* "~&Created a ~a \"~a\".~%" type name)
-           (format t "~&~a~%" path)))))))
+           (format t "~&~a~%" path)
+           path))))))
 
 (defun generate ()
   (coleslaw:main *default-pathname-defaults*))
diff --git a/coleslaw-test.asd b/coleslaw-test.asd
index 5426a07..e077420 100644
--- a/coleslaw-test.asd
+++ b/coleslaw-test.asd
@@ -4,10 +4,11 @@
   :description "A test suite for coleslaw."
   :license "BSD"
   :author "Brit Butler <redline6561@gmail.com>"
-  :depends-on (:coleslaw :prove)
+  :depends-on (:coleslaw :coleslaw-cli :prove)
   :defsystem-depends-on (:prove-asdf)
   :components ((:module "tests"
                 :components
-                        ((:test-file "tests"))))
+                ((:test-file "tests")
+                 (:test-file "cli"))))
   :perform (test-op :after (op c)
                     (uiop:symbol-call :prove 'run c)))
diff --git a/tests/cli.lisp b/tests/cli.lisp
new file mode 100644
index 0000000..2376aec
--- /dev/null
+++ b/tests/cli.lisp
@@ -0,0 +1,23 @@
+
+(in-package :coleslaw-tests)
+
+(plan 2)
+
+(let ((*default-pathname-defaults*
+       (pathname
+        (format nil "~a/"
+                (uiop:run-program `("mktemp" "-d")
+                                  :output `(:string :stripped t))))))
+  (coleslaw-cli:setup)
+  (let ((file (coleslaw-cli:new)))
+    (ok (probe-file file)))
+  (coleslaw-cli:generate)
+  (print (format nil "~adeploy/index.html" *default-pathname-defaults*))
+  (ok (probe-file (format nil "~adeploy/index.html" *default-pathname-defaults*))))
+
+(finalize)
+
+  
+  
+
+