package template.experiment1 import kotlin.template.experiment1.* import kotlin.test.assertEquals import kotlin.dom.toXmlString import junit.framework.TestCase import org.w3c.dom.Node class HtmlTemplateTest : TestCase() { fun testTemplate(): Unit { val foo = "James" val bar = "x > 1" val format = I18nFormatter() // Code generated by the following template expression: // // val actual = format.toHtml("
hey $bar
") val actual = format.toHtml{ it.text("hey ") it.expression(bar) it.text("
") } assertEquals("hey x > 1
", actual) println("Generated HTML: $actual") } }