package template import kotlin.template.* import kotlin.test.assertEquals import junit.framework.TestCase import java.util.Date import java.util.Locale class LocaleTemplateTest : TestCase() { fun testDefaultLocale() : Unit { format(LocaleFormatter()) } fun testFrance() : Unit { format(LocaleFormatter(Locale.FRANCE.sure())) } fun testGermany() : Unit { format(LocaleFormatter(Locale.GERMANY.sure())) } fun format(formatter: LocaleFormatter): Unit { val name = "James" // TODO currently numbers cause: java.lang.ClassNotFoundException: jet.Number //val price: Double = 1.99 val now = Date() // Code generated by the following template expression: // // val actual = format.toLocale("hello $name!") // TODO will use a tuple soon //val actual = formatter.format(StringTemplate(Tuple2("hello ", name)) val actual = StringTemplate(array("hello ", name, // TODO currently numbers cause: java.lang.ClassNotFoundException: jet.Number // " price ", price, " data ", now)).toString(formatter) println("Got text: $actual") } }