diff --git a/poko-tests/performance/src/test/kotlin/JsPerformanceTest.kt b/poko-tests/performance/src/test/kotlin/JsPerformanceTest.kt index 355036e2..4a9bf0df 100644 --- a/poko-tests/performance/src/test/kotlin/JsPerformanceTest.kt +++ b/poko-tests/performance/src/test/kotlin/JsPerformanceTest.kt @@ -1,15 +1,24 @@ -import assertk.all + +import assertk.assertAll import assertk.assertThat -import assertk.assertions.contains -import assertk.assertions.doesNotContain +import assertk.assertions.hasSize +import assertk.assertions.isEmpty import org.junit.Test class JsPerformanceTest { @Test fun `equals does not perform redundant instanceof check`() { val javascript = jsOutput().readText() - assertThat(javascript).all { - contains("other instanceof IntAndLong") - doesNotContain("THROW_CCE") + + // Hack to filter out data classes, which do have the `THROW_CCE` code: + val intAndLongLines = javascript.split("\n").filter { it.contains("IntAndLong") } + assertAll { + assertThat( + actual = intAndLongLines.filter { it.contains("other instanceof IntAndLong") }, + ).hasSize(1) + + assertThat( + actual = intAndLongLines.filter { it.contains("THROW_CCE") }, + ).isEmpty() } } }