summaryrefslogtreecommitdiff
path: root/tests/post.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/post.scm')
-rw-r--r--tests/post.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/post.scm b/tests/post.scm
index bfc0d0e..38fcfbe 100644
--- a/tests/post.scm
+++ b/tests/post.scm
@@ -26,6 +26,8 @@
(define (make-date* year month day)
(make-date 0 0 0 0 day month year 0))
+(define %tzoffset (date-zone-offset (current-date)))
+
(test-equal "post-ref"
'(hello test)
(post-ref (make-post "foo.skr" '((tags hello test)) '()) 'tags))
@@ -62,9 +64,20 @@
(parse-metadata 'tags "foo, bar, baz"))
(test-equal "parse-metadata, date"
- (make-date 0 0 30 22 15 10 2015 (date-zone-offset (current-date)))
+ (make-date 0 0 30 22 15 10 2015 %tzoffset)
(parse-metadata 'date "2015-10-15 22:30"))
+(test-equal "read-metadata-headers"
+ `((tags "foo" "bar" "baz")
+ (date . ,(make-date 0 0 30 22 15 10 2015 %tzoffset))
+ (title . "Hello, World!"))
+ (pk 'meta (call-with-input-string "title: Hello, World!
+date: 2015-10-15 22:30
+tags: foo, bar, baz
+---
+"
+ read-metadata-headers)))
+
(test-end)