I have a function:
fun sumUpStrings(strings: List<String>) = strings.map { it.toFloat() }.sum()
and a test:
@Test
fun testSumUpStrings() {
val strings = listOf(
"12.2", "7.0", "33.33"
)
val result = mapper.sumUpStrings(strings)
assertThat(result).isEqualTo(12.2 + 7.0 + 33.33)
}
The output of the test is:
expected:<52.53[]> but was:<52.53[0003f]> Expected :52.53[] Actual
:52.53[0003f]
I was expecting the test to succeed. Can someone explain this phenomenon to me?