diff options
| author | 2025-01-27 06:59:37 -0500 | |
|---|---|---|
| committer | 2025-01-27 06:59:37 -0500 | |
| commit | db3c450a9279f54229775fb27512a032cd959a54 (patch) | |
| tree | b1863dcc6fde1a32c21fbc9fde6a622b166b2577 /tests | |
| parent | expand starts and continues by adding current node as argument (diff) | |
fix spurious newlines
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.scm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/run.scm b/tests/run.scm index 4e8c8ae..87cbfa3 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -79,7 +79,7 @@ (list-ref _ 0) (xstring->string _)))) (test-equal "two lines" str "hello,\nworld\n")) - (test-group "multiple paragraphs" + (test-group "multiple paragraphs in block quote" (let ((lst (chain (parse->document "> hello") (parse->document "> " _) (parse->document "> world" _) @@ -94,13 +94,29 @@ (test-equal "second paragraph" (xstring->string (list-ref lst 1)) "world\n"))) + (test-group "interrupted by paragraph break" + (let ((lst (chain (parse->document "> hello,") + (parse->document "" _) + (parse->document "world" _) + (node-children _) + (list-queue-list _)))) + (test-assert "first is block quote" (block-quote? (list-ref lst 0))) + (let ((quote-par (chain (list-ref lst 0) + (node-children _) + (list-queue-list _) + (list-ref _ 0) + (xstring->string _)))) + (test-equal "quote text" "hello,\n" quote-par)) + (let ((text (chain (list-ref lst 1) + (xstring->string _)))) + (test-equal "paragraph text" "world\n" text)))) (test-group "interrupted" (let ((lst (chain (parse->document "> hello, world") (parse->document "outside of a block quote" _) (node-children _) (list-queue-list _)))) (test-assert "first is block quote" - (block-node? (list-ref lst 0))) + (block-quote? (list-ref lst 0))) (let ((quote-paragraph (chain (list-ref lst 0) (node-children _) (list-queue-list _) |
