Merge pull request #9 from iampatbrown/master
Minor changes to String Templates Exercise 1 and 2
This commit is contained in:
commit
346b479496
|
@ -41,8 +41,8 @@ class TestExpressionsAndStatementsExercise2 {
|
|||
Assert.assertTrue("The return type of '$func()' is '$type'; " +
|
||||
"'$type' should be printed to the console", type in output)
|
||||
}
|
||||
checkType("Int", "g")
|
||||
checkType("String", "h")
|
||||
checkType("Unit", "f")
|
||||
checkType("Int", "f")
|
||||
checkType("String", "g")
|
||||
checkType("Unit", "h")
|
||||
}
|
||||
}
|
|
@ -6,6 +6,6 @@ fun findMax(first: Int, second: Int): Int =
|
|||
fun main() {
|
||||
val first = 17
|
||||
val second = 31
|
||||
println("The maximum between $first and $second is " +
|
||||
println("The maximum of $first and $second is " +
|
||||
"${findMax(first, second)}.")
|
||||
}
|
|
@ -4,7 +4,7 @@ files:
|
|||
visible: true
|
||||
placeholders:
|
||||
- offset: 169
|
||||
length: 88
|
||||
length: 83
|
||||
placeholder_text: TODO()
|
||||
- name: test/output.txt
|
||||
visible: false
|
||||
|
|
|
@ -1 +1 @@
|
|||
The maximum between 17 and 31 is 31.
|
||||
The maximum of 17 and 31 is 31.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package stringTemplatesExercise2
|
||||
|
||||
fun record(index: Int, status: String, message: String): String =
|
||||
"$index. [$status] $message\n"
|
||||
"$index [$status] $message\n"
|
||||
|
||||
fun main() {
|
||||
print(record(1, "OK", "Everything is fine."))
|
||||
|
|
|
@ -4,7 +4,7 @@ files:
|
|||
visible: true
|
||||
placeholders:
|
||||
- offset: 102
|
||||
length: 30
|
||||
length: 29
|
||||
placeholder_text: TODO()
|
||||
- name: test/Tests.kt
|
||||
visible: false
|
||||
|
|
|
@ -9,7 +9,7 @@ import util.TIMEOUT
|
|||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class TestStringTemplatesExercise2 {
|
||||
private fun checkRecord(index: Int, status: String, message: String) {
|
||||
val record = "$index. [$status] $message\n"
|
||||
val record = "$index [$status] $message\n"
|
||||
Assert.assertEquals("""record($index, "$status", "$message") should return $record""",
|
||||
record, record(index, status, message))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue