moved the stdlib tests into the same directory as the stdlib, so it works a bit better with maven support in IDEA
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package test.template
|
||||
|
||||
import kotlin.template.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
import junit.framework.TestCase
|
||||
|
||||
class HtmlTemplateTest : TestCase() {
|
||||
fun testTemplate(): Unit {
|
||||
val foo = "James"
|
||||
val bar = "x > 1"
|
||||
|
||||
// Code generated by the following template expression:
|
||||
//
|
||||
// val actual = "<h1>$foo</h1> <p>hey $bar</p>".toHtml()
|
||||
|
||||
// TODO will use a tuple soon
|
||||
//val actual = StringTemplate(Tuple3<String,String,String>("<h1>", foo, "</h1> <p>hey ", bar, "</p>")).toHtml()
|
||||
val actual = StringTemplate(array("<h1>", foo, "</h1> <p>hey ", bar, "</p>")).toHtml()
|
||||
|
||||
assertEquals("<h1>James</h1> <p>hey x > 1</p>", actual)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package test.template
|
||||
|
||||
import kotlin.template.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
import junit.framework.TestCase
|
||||
|
||||
class StringTemplateTest : TestCase() {
|
||||
fun testTemplate(): Unit {
|
||||
val name = "James"
|
||||
|
||||
// Code generated by the following template expression:
|
||||
//
|
||||
// val actual = "hello $name!".toString()
|
||||
|
||||
// TODO will use a tuple soon
|
||||
//val actual = StringTemplate(Tuple3<String,String,String>("hello ", name, "!"))).toString()
|
||||
val actual = StringTemplate(array("hello ", name, "!")).toString()
|
||||
|
||||
assertEquals("hello James!", actual)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user