Skip to content

Commit

Permalink
Merge pull request Kotlin#95 from romanmikhailov/bugfix/tests/38_the_…
Browse files Browse the repository at this point in the history
…function_apply_inconsistence

Fix inconsistent unit tests for 38 (The Function Apply) suite.
  • Loading branch information
svtk authored Jul 7, 2017
2 parents 0c938d3 + 9777f00 commit d338b6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/v_builders/_38_The_Function_Apply.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import java.util.*

class _38_The_Function_Apply {
@Test fun testBuildString() {
val expected = buildString()
val actual = StringBuilder().apply {
val expected = StringBuilder().apply {
append("Numbers: ")
for (i in 1..10) {
append(i)
}
}.toString()
val actual = buildString()
assertEquals("String should be built:", expected, actual)
}

@Test fun testBuildMap() {
val expected = buildMap()
val actual = HashMap<Int, String>().apply {
val expected = HashMap<Int, String>().apply {
put(0, "0")
for (i in 1..10) {
put(i, "$i")
}
}
val actual = buildMap()
assertEquals("Map should be filled with the right values", expected, actual)
}
}

0 comments on commit d338b6b

Please sign in to comment.