From 7114df6b31ee94caa2c41d74a53d278aaa9feeac Mon Sep 17 00:00:00 2001 From: iampatbrown Date: Thu, 4 Jun 2020 12:47:06 +1000 Subject: [PATCH 1/3] Minor fix: expected result different from exercise text --- Programming Basics/String Templates/Exercise 1/src/Task.kt | 2 +- Programming Basics/String Templates/Exercise 1/task-info.yaml | 2 +- Programming Basics/String Templates/Exercise 1/test/output.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Programming Basics/String Templates/Exercise 1/src/Task.kt b/Programming Basics/String Templates/Exercise 1/src/Task.kt index 0ef77a0e..a5f4bf04 100644 --- a/Programming Basics/String Templates/Exercise 1/src/Task.kt +++ b/Programming Basics/String Templates/Exercise 1/src/Task.kt @@ -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)}.") } \ No newline at end of file diff --git a/Programming Basics/String Templates/Exercise 1/task-info.yaml b/Programming Basics/String Templates/Exercise 1/task-info.yaml index 1162094b..c9ec0389 100644 --- a/Programming Basics/String Templates/Exercise 1/task-info.yaml +++ b/Programming Basics/String Templates/Exercise 1/task-info.yaml @@ -4,7 +4,7 @@ files: visible: true placeholders: - offset: 169 - length: 88 + length: 83 placeholder_text: TODO() - name: test/output.txt visible: false diff --git a/Programming Basics/String Templates/Exercise 1/test/output.txt b/Programming Basics/String Templates/Exercise 1/test/output.txt index e1bfa188..d5c30707 100644 --- a/Programming Basics/String Templates/Exercise 1/test/output.txt +++ b/Programming Basics/String Templates/Exercise 1/test/output.txt @@ -1 +1 @@ -The maximum between 17 and 31 is 31. +The maximum of 17 and 31 is 31. From fefd93d34e4a2d4c3dbba12f3170cf0b70094d65 Mon Sep 17 00:00:00 2001 From: iampatbrown Date: Thu, 4 Jun 2020 12:47:56 +1000 Subject: [PATCH 2/3] Minor fix: remove period after index to match exercise text --- Programming Basics/String Templates/Exercise 2/src/Task.kt | 2 +- Programming Basics/String Templates/Exercise 2/task-info.yaml | 2 +- Programming Basics/String Templates/Exercise 2/test/Tests.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Programming Basics/String Templates/Exercise 2/src/Task.kt b/Programming Basics/String Templates/Exercise 2/src/Task.kt index 02d6267d..bab530f9 100644 --- a/Programming Basics/String Templates/Exercise 2/src/Task.kt +++ b/Programming Basics/String Templates/Exercise 2/src/Task.kt @@ -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.")) diff --git a/Programming Basics/String Templates/Exercise 2/task-info.yaml b/Programming Basics/String Templates/Exercise 2/task-info.yaml index d48e4584..5ba6981a 100644 --- a/Programming Basics/String Templates/Exercise 2/task-info.yaml +++ b/Programming Basics/String Templates/Exercise 2/task-info.yaml @@ -4,7 +4,7 @@ files: visible: true placeholders: - offset: 102 - length: 30 + length: 29 placeholder_text: TODO() - name: test/Tests.kt visible: false diff --git a/Programming Basics/String Templates/Exercise 2/test/Tests.kt b/Programming Basics/String Templates/Exercise 2/test/Tests.kt index 4c9a19ce..db5a9839 100644 --- a/Programming Basics/String Templates/Exercise 2/test/Tests.kt +++ b/Programming Basics/String Templates/Exercise 2/test/Tests.kt @@ -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)) } From b79b201aab63e44537340e69577689f597690a0f Mon Sep 17 00:00:00 2001 From: iampatbrown Date: Thu, 4 Jun 2020 17:19:04 +1000 Subject: [PATCH 3/3] Minor fix: matched function name to expected type --- .../Expressions & Statements/Exercise 2/test/Tests.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt b/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt index cc061ceb..f5aa16ad 100644 --- a/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt +++ b/Programming Basics/Expressions & Statements/Exercise 2/test/Tests.kt @@ -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") } } \ No newline at end of file