Skip to content

Commit

Permalink
fixing test with csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Dec 19, 2022
1 parent c8ac59e commit d281ab9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public fun AnyFrame.writeCSV(
format: CSVFormat = CSVFormat.DEFAULT,
) {
format.print(writer).use { printer ->
if (format.getSkipHeaderRecord() == false) {
if (!format.skipHeaderRecord) {
printer.printRecord(columnNames())
}
forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ class CsvTests {
}

@Test
fun `write csv whitout header produce correct file`() {
fun `write csv without header produce correct file`() {
val df = dataFrameOf("a", "b", "c")(
1, 2, 3,
1, 3, 2
1, 3, 2,
)
df.writeCSV(
"src/test/resources/without_header.csv",
CSVFormat.DEFAULT.withSkipHeaderRecord()
CSVFormat.DEFAULT.withSkipHeaderRecord(),
)
val producedFile = File("src/test/resources/without_header.csv")
producedFile.exists() shouldBe true
producedFile.readText() shouldBe "a,b,c\r\n1,2,3\r\n1,3,2\r\n"
producedFile.readText() shouldBe "1,2,3\r\n1,3,2\r\n"
producedFile.delete()
}

Expand Down

0 comments on commit d281ab9

Please sign in to comment.