Remove obsolete and not relevant to stdlib tests
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
package language
|
||||
|
||||
import org.junit.Test as test
|
||||
import kotlin.test.*
|
||||
|
||||
class Product(val name: String, val price: Double) {
|
||||
}
|
||||
|
||||
class Customer(val name: String, val products: List<Product>) {
|
||||
}
|
||||
|
||||
|
||||
fun customerTemplate(customer: Customer) = """
|
||||
<html>
|
||||
<body>
|
||||
<h1>Hello ${customer.name}</h1>
|
||||
<ul>
|
||||
${customer.products.map{ productSnippet(it) }.joinToString("\n")}
|
||||
</ul>
|
||||
<p>lets do some kool stuff</p>
|
||||
</body>
|
||||
"""
|
||||
|
||||
fun productSnippet(product: Product) = "<li>${product.name}. Price : ${product.price}</li>"
|
||||
|
||||
// TODO support number formatting methods?
|
||||
// fun productSnippet(product: Product) = "<li>${product.name}. Price : ${product.price.format('## ###,00')} </li>"
|
||||
|
||||
val EXPECTED = """
|
||||
<html>
|
||||
<body>
|
||||
<h1>Hello James</h1>
|
||||
<ul>
|
||||
<li>Beer. Price : 1.99</li>
|
||||
<li>Wine. Price : 5.99</li>
|
||||
</ul>
|
||||
<p>lets do some kool stuff</p>
|
||||
</body>
|
||||
"""
|
||||
|
||||
class StringExpressionExampleTest {
|
||||
val customer = Customer("James", arrayListOf(Product("Beer", 1.99), Product("Wine", 5.99)))
|
||||
|
||||
@test fun testExpressions(): Unit {
|
||||
assertEquals(EXPECTED, customerTemplate(customer))
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package language.main
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println("Hello world!")
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package language.mainint
|
||||
|
||||
fun main(args: Array<String>): Int {
|
||||
println("Hello world: Int")
|
||||
return 0
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package language.mainunit
|
||||
|
||||
fun main(args: Array<String>): Unit {
|
||||
println("Hello world: Unit")
|
||||
}
|
||||
Reference in New Issue
Block a user