Skip to content

Commit

Permalink
Add localization full pipeline tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Sep 18, 2024
1 parent b7d1112 commit 58afe45
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.io.File
import kotlin.test.Test
import kotlin.test.assertContains
import kotlin.test.assertEquals
import kotlin.test.assertFails
import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
import kotlin.test.assertIs
Expand Down Expand Up @@ -1036,6 +1037,61 @@ class FullPipelineTest {
}
}

@Test
fun localization() {
execute(
"""
.doclang {english}
.localization {mytable}
- English
- morning: Good morning
- evening: Good evening
- Italian
- morning: Buongiorno
- evening: Buonasera
> .localize {mytable:morning}.
""".trimIndent(),
) {
assertEquals("<blockquote><p>Good morning.</p></blockquote>", it)
}

execute(
"""
.doclang {italian}
.localization {mytable}
- English
- theorem: Theorem
- Italian
- theorem: Teorema
.function {theorem}
**.localize {mytable:theorem}.**
.theorem Test
""".trimIndent(),
) {
assertEquals("<p><strong>Teorema.</strong> Test</p>", it)
}

assertFails {
execute(
"""
.doclang {english}
.localization {mytable}
- English
- morning: Good morning
- evening: Good evening
- Italian
- morning: Buongiorno
- evening: Buonasera
> .localize {mytable:afternoon}.
""".trimIndent(),
) {}
}
}

@Test
fun `media storage`() {
execute(
Expand Down

0 comments on commit 58afe45

Please sign in to comment.