Skip to content

Commit

Permalink
putting char later in the parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Oct 3, 2024
1 parent c0d76ca commit 52e463f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ internal object Parsers : GlobalParserOptions {
}

private val parsersOrder = listOf(
// Char
stringParser<Char> { it.singleOrNull() },
// Int
stringParser<Int> { it.toIntOrNull() },
// Long
Expand Down Expand Up @@ -412,6 +410,8 @@ internal object Parsers : GlobalParserOptions {
null
}
},
// Char
stringParser<Char> { it.singleOrNull() },
// No parser found, return as String
// must be last in the list of parsers to return original unparsed string
stringParser<String> { it },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CsvTests {
df.nrow shouldBe 5
df.columnNames()[5] shouldBe "duplicate1"
df.columnNames()[6] shouldBe "duplicate11"
df["duplicate1"].type() shouldBe typeOf<String?>()
df["duplicate1"].type() shouldBe typeOf<Char?>()
df["double"].type() shouldBe typeOf<Double?>()
df["time"].type() shouldBe typeOf<LocalDateTime>()

Expand All @@ -89,7 +89,7 @@ class CsvTests {
df.nrow shouldBe 5
df.columnNames()[5] shouldBe "duplicate1"
df.columnNames()[6] shouldBe "duplicate11"
df["duplicate1"].type() shouldBe typeOf<String?>()
df["duplicate1"].type() shouldBe typeOf<Char?>()
df["double"].type() shouldBe typeOf<Double?>()
df["number"].type() shouldBe typeOf<Double>()
df["time"].type() shouldBe typeOf<LocalDateTime>()
Expand Down

0 comments on commit 52e463f

Please sign in to comment.