summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-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(