1
1
Fork 0

Merge pull request #9 from iampatbrown/master

Minor changes to String Templates Exercise 1 and 2
This commit is contained in:
Svetlana Isakova 2020-11-11 20:51:08 +01:00 committed by GitHub
commit 346b479496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 9 deletions

View File

@ -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")
}
}

View File

@ -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)}.")
}

View File

@ -4,7 +4,7 @@ files:
visible: true
placeholders:
- offset: 169
length: 88
length: 83
placeholder_text: TODO()
- name: test/output.txt
visible: false

View File

@ -1 +1 @@
The maximum between 17 and 31 is 31.
The maximum of 17 and 31 is 31.

View File

@ -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."))

View File

@ -4,7 +4,7 @@ files:
visible: true
placeholders:
- offset: 102
length: 30
length: 29
placeholder_text: TODO()
- name: test/Tests.kt
visible: false

View File

@ -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))
}