diff --git a/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt b/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt index a85280f5..12a51f65 100644 --- a/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt +++ b/test/src/test/kotlin/eu/iamgio/quarkdown/test/FullPipelineTest.kt @@ -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 @@ -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("

Good morning.

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

Teorema. Test

", 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(