Commit Diff
Diff:
721a55a9e57cebcde535bfaa77e3bbaae956d55b
a903e42230f413b43c0115c69fc044d4b1c8b3b4
Commit:
a903e42230f413b43c0115c69fc044d4b1c8b3b4
Tree:
13fec022489018b1cfdddcde8e242d610e1b44ff
Author:
Omar Polo <op@omarpolo.com>
Date:
Mon Jan 17 10:05:31 2022 UTC
Message:
add some verbatim-related tests
commit - 721a55a9e57cebcde535bfaa77e3bbaae956d55b
commit + a903e42230f413b43c0115c69fc044d4b1c8b3b4
blob - 3a463a0593a373047b354add2c06b13dd0c2c74f
blob + 7d9bf6b7bc2e80c99d90aced9a8cca96bb4888a3
--- t/gemtext-tests.lisp
+++ t/gemtext-tests.lisp
@@ -39,3 +39,26 @@
for (str . exp) in suite
do (assert-true (cmp-lines (gemtext:parse-string str)
(list exp)))))
+
+(deftest test-parse-verbatim (gemtext-suite)
+ (let* ((content (format nil "hello~%"))
+ (doc (format nil "```~%~A```" content)))
+ (assert-true (cmp-lines (gemtext:parse-string doc)
+ (list (make-instance 'gemtext:verbatim
+ :text content))))))
+
+(deftest test-parse-verbatim-with-alt (gemtext-suite)
+ (let* ((alt "some text")
+ (content (format nil "hello~%"))
+ (doc (format nil "```~A~%~A```" alt content)))
+ (assert-true (cmp-lines (gemtext:parse-string doc)
+ (list (make-instance 'gemtext:verbatim
+ :alt alt
+ :text content))))))
+
+(deftest test-parse-open-verbatim-block (gemtext-suite)
+ (let* ((content (format nil "hello~%"))
+ (doc (format nil "```~%~A" content)))
+ (assert-true (cmp-lines (gemtext:parse-string doc)
+ (list (make-instance 'gemtext:verbatim
+ :text content))))))
Omar Polo