2021-01-14 02:07:55 +01:00
|
|
|
(in-package :panettone.tests)
|
|
|
|
(declaim (optimize (safety 3)))
|
|
|
|
|
|
|
|
(defmacro inline-markdown-unit-test (name input expected)
|
|
|
|
`(test ,name
|
|
|
|
(is (equal
|
|
|
|
,expected
|
|
|
|
(with-output-to-string (*standard-output*)
|
|
|
|
(render-inline-markdown ,input))))))
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-typical-test
|
2021-04-11 02:24:21 +02:00
|
|
|
"hello *world*, here is ~~no~~ `code`!"
|
2021-01-14 02:07:55 +01:00
|
|
|
"hello <em>world</em>, here is <del>no</del> <code>code</code>!")
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-two-emphasize-types-test
|
2021-04-11 02:24:21 +02:00
|
|
|
"*stress* *this*"
|
2021-01-14 02:07:55 +01:00
|
|
|
"<em>stress</em> <em>this</em>")
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-html-escaping-test
|
|
|
|
"<tag>öäü"
|
2022-01-14 00:03:02 +01:00
|
|
|
"<tag>öäü")
|
2021-01-14 02:07:55 +01:00
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-nesting-test
|
|
|
|
"`inside code *anything* goes`, but also ~~*here*~~"
|
|
|
|
"<code>inside code *anything* goes</code>, but also <del>*here*</del>")
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-escaping-test
|
2021-04-11 02:24:21 +02:00
|
|
|
"A backslash \\\\ shows: \\*, \\` and \\~~"
|
|
|
|
"A backslash \\ shows: *, ` and ~~")
|
2021-01-14 02:07:55 +01:00
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-nested-escaping-test
|
|
|
|
"`prevent \\`code\\` from ending, but never stand alone \\\\`"
|
|
|
|
"<code>prevent `code` from ending, but never stand alone \\</code>")
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-escape-normal-tokens-test
|
|
|
|
"\\Normal tokens \\escaped?"
|
|
|
|
"\\Normal tokens \\escaped?")
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-no-unclosed-tags-test
|
2021-04-11 02:24:21 +02:00
|
|
|
"A tag, once opened, *must be closed"
|
2021-01-14 02:07:55 +01:00
|
|
|
"A tag, once opened, <em>must be closed</em>")
|
|
|
|
|
|
|
|
(inline-markdown-unit-test
|
|
|
|
inline-markdown-unicode-safe
|
|
|
|
"Does Unicode 👨👨👧👦 break \\👩🏾🦰 tokenization?"
|
2022-01-14 00:03:02 +01:00
|
|
|
"Does Unicode 👨‍👨‍👧‍👦 break \\👩🏾‍🦰 tokenization?")
|