Skip to content

Commit 9f5295f

Browse files
authored
Merge pull request #873 from Kotlin/flaky-json-write-test
Fixed flaky jsonWrite test
2 parents feb491b + 3c35bbb commit 9f5295f

File tree

1 file changed

+3
-7
lines changed
  • tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api

1 file changed

+3
-7
lines changed

tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Write.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Write : TestBase() {
5454
csvStr shouldStartWith """
5555
name;age;city;weight;isHappy
5656
"{""firstName"":""Alice"",""lastName"":""Cooper""}";15;London;54;true
57-
""".rejoinWithSystemLineSeparator()
57+
""".trimIndent().lines().joinToString(System.lineSeparator())
5858
}
5959

6060
@Test
@@ -73,7 +73,7 @@ class Write : TestBase() {
7373
"city": "London",
7474
"weight": 54,
7575
"isHappy": true
76-
""".rejoinWithSystemLineSeparator()
76+
""".trimIndent()
7777
}
7878

7979
@Test
@@ -215,7 +215,7 @@ class Write : TestBase() {
215215
// Specify mismatch subscriber
216216
mismatchSubscriber = writeMismatchMessage,
217217

218-
).use { writer: ArrowWriter ->
218+
).use { writer: ArrowWriter ->
219219

220220
// Save to any format and sink, like in the previous example
221221
writer.writeArrowFeather(file)
@@ -241,10 +241,6 @@ class Write : TestBase() {
241241
}
242242

243243
companion object {
244-
private fun String.rejoinWithSystemLineSeparator() = rejoinWithLineSeparator(System.lineSeparator())
245-
246-
private fun String.rejoinWithLineSeparator(separator: String) = trimIndent().lines().joinToString(separator)
247-
248244
private fun useTempFile(action: (File) -> Unit) {
249245
val file = kotlin.io.path.createTempFile("dataframeWriteTest")
250246
action(file.toFile())

0 commit comments

Comments
 (0)