52 lines
1 KiB
Fennel
52 lines
1 KiB
Fennel
(local blocks (require :block))
|
|
(local t (require :test.faith))
|
|
|
|
|
|
(fn setup-all []
|
|
(let [f (assert (io.open "./test/data/lists.incd"))
|
|
contents (f:read "*all")]
|
|
{:lists contents}))
|
|
|
|
(fn test-section [])
|
|
(fn test-image [])
|
|
(fn test-tag [])
|
|
(fn test-quote [])
|
|
(fn test-metadata [])
|
|
(fn test-code [])
|
|
(fn test-header [])
|
|
(fn test-list [{: lists}]
|
|
(let [expected [{:block "= The List Page =
|
|
|
|
"
|
|
:type "Header"}
|
|
|
|
{:block "\n" :type "Paragraph"}
|
|
{:block "- First Element
|
|
- Second Element
|
|
|
|
\t- Sub element
|
|
|
|
\t- Second Sub Element
|
|
|
|
\t\t- Third sub element
|
|
|
|
- Third Element
|
|
|
|
"
|
|
:type "List"}
|
|
{:block "\n" :type "Paragraph"}
|
|
{:block "- This is the second list
|
|
- With only single layer
|
|
|
|
- And three elements
|
|
|
|
"
|
|
:type "List"}]
|
|
actual (blocks.lexer lists blocks.grammar)]
|
|
(t.= expected actual)))
|
|
(fn test-footnote [])
|
|
(fn test-paragraph [])
|
|
|
|
{: setup-all
|
|
: test-list}
|