Skip to content

Commit d281ab9

Browse files
committed
fixing test with csv
1 parent c8ac59e commit d281ab9

File tree

2 files changed

+5
-5
lines changed
  • core/src
    • main/kotlin/org/jetbrains/kotlinx/dataframe/io
    • test/kotlin/org/jetbrains/kotlinx/dataframe/io

2 files changed

+5
-5
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public fun AnyFrame.writeCSV(
332332
format: CSVFormat = CSVFormat.DEFAULT,
333333
) {
334334
format.print(writer).use { printer ->
335-
if (format.getSkipHeaderRecord() == false) {
335+
if (!format.skipHeaderRecord) {
336336
printer.printRecord(columnNames())
337337
}
338338
forEach {

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/CsvTests.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,18 @@ class CsvTests {
234234
}
235235

236236
@Test
237-
fun `write csv whitout header produce correct file`() {
237+
fun `write csv without header produce correct file`() {
238238
val df = dataFrameOf("a", "b", "c")(
239239
1, 2, 3,
240-
1, 3, 2
240+
1, 3, 2,
241241
)
242242
df.writeCSV(
243243
"src/test/resources/without_header.csv",
244-
CSVFormat.DEFAULT.withSkipHeaderRecord()
244+
CSVFormat.DEFAULT.withSkipHeaderRecord(),
245245
)
246246
val producedFile = File("src/test/resources/without_header.csv")
247247
producedFile.exists() shouldBe true
248-
producedFile.readText() shouldBe "a,b,c\r\n1,2,3\r\n1,3,2\r\n"
248+
producedFile.readText() shouldBe "1,2,3\r\n1,3,2\r\n"
249249
producedFile.delete()
250250
}
251251

0 commit comments

Comments
 (0)