summaryrefslogtreecommitdiff
path: root/src/test/kotlin/moe
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-03-24 20:45:58 +0100
committerLinnea Gräf <nea@nea.moe>2024-03-24 20:45:58 +0100
commit9bacb15dae9dcf7eea34fee650c8025ca946fe47 (patch)
tree7b80be7da738a0a43eaeca1523e5d4e4faa221e9 /src/test/kotlin/moe
parent4f7a626cdda9beef3ac058427594b7295045a7e2 (diff)
downloadblog-infra-9bacb15dae9dcf7eea34fee650c8025ca946fe47.tar.gz
blog-infra-9bacb15dae9dcf7eea34fee650c8025ca946fe47.tar.bz2
blog-infra-9bacb15dae9dcf7eea34fee650c8025ca946fe47.zip
Add list parser
Diffstat (limited to 'src/test/kotlin/moe')
-rw-r--r--src/test/kotlin/moe/nea/blog/md/test/ListTest.kt104
-rw-r--r--src/test/kotlin/moe/nea/blog/md/test/TestItalics.kt1
2 files changed, 104 insertions, 1 deletions
diff --git a/src/test/kotlin/moe/nea/blog/md/test/ListTest.kt b/src/test/kotlin/moe/nea/blog/md/test/ListTest.kt
new file mode 100644
index 0000000..0ac8f1e
--- /dev/null
+++ b/src/test/kotlin/moe/nea/blog/md/test/ListTest.kt
@@ -0,0 +1,104 @@
+package moe.nea.blog.md.test
+
+import kotlin.test.Test
+
+class ListTest : MarkdownTest() {
+ @Test
+ fun testBasicList() {
+ assertDocumentFormat(
+ """
+ Some Text:
+ <list>
+ <element>
+ First
+ </element>
+ <element>
+ Second
+ </element>
+ </list>
+ """.trimIndent(),
+ """
+ Some Text:
+ - First
+ - Second
+ """.trimIndent()
+ )
+ }
+ @Test
+ fun testBlockContinuation() {
+ assertDocumentFormat(
+ """
+ Some Text:
+ <list>
+ <element>
+ First More First
+ </element>
+ <element>
+ Second
+ More Second
+ </element>
+ </list>
+ """.trimIndent(),
+ """
+ Some Text:
+ - First
+ More First
+ - Second
+
+ More Second
+ """.trimIndent()
+ )
+ }
+ @Test
+ fun testNestedLists() {
+ assertDocumentFormat(
+ """
+ Some Text:
+ <list>
+ <element>
+ First
+ <list>
+ <element>
+ Another List
+ </element>
+ </list>
+ </element>
+ <element>
+ Second
+ </element>
+ </list>
+ """.trimIndent(),
+ """
+ Some Text:
+ - First
+ - Another List
+ - Second
+ """.trimIndent()
+ )
+ }
+ @Test
+ fun testCodeBlockInList() {
+ assertDocumentFormat(
+ """
+ <list>
+ <element>
+ <code language=java>
+ public class Test {
+
+ public static void main(String...args) {}
+ }
+ </code>
+ </element>
+ </list>
+ """.trimIndent(),
+ """
+ - ```java
+ public class Test {
+
+ public static void main(String...args) {}
+ }
+ ```
+ """.trimIndent()
+ )
+ }
+} \ No newline at end of file
diff --git a/src/test/kotlin/moe/nea/blog/md/test/TestItalics.kt b/src/test/kotlin/moe/nea/blog/md/test/TestItalics.kt
index f4c1669..dee92bd 100644
--- a/src/test/kotlin/moe/nea/blog/md/test/TestItalics.kt
+++ b/src/test/kotlin/moe/nea/blog/md/test/TestItalics.kt
@@ -14,7 +14,6 @@ class TestItalics : MarkdownTest() {
assertInlineFormat("<i><b>both</b> just italics</i>", "***both** just italics*")
}
-
@Test
fun otherMarkdownInItalics() {
assertInlineFormat(