Browse Source

Change test to use variables

main
Marie-Joseph 1 year ago
parent
commit
1cbdecb233
  1. 10
      blog.hy

10
blog.hy

@ -14,10 +14,12 @@ Blog helper functions
"""
Test to ensure retrieve-posts is working properly.
"""
(assert (= (first (retrieve-posts post-name)) (+ "blog/" post-name ".html")))
(assert (= (retrieve-posts None) (lfor post (listdir "templates/blog/")
:if (.endswith post ".html")
(+ "blog/" post)))))
(assert (= (first (retrieve-posts post-name))
(+ _posts-dir post-name _posts-suffix)))
(assert (= (retrieve-posts None)
(lfor post (listdir (+ _posts-prefix _posts-dir))
:if (.endswith post _posts-suffix)
(+ _posts-dir post)))))
(defn retrieve-posts [[post-name None]]
"""