Skip to content

Commit

Permalink
Added test case to read CSV with ion symbol as input
Browse files Browse the repository at this point in the history
  • Loading branch information
lziq committed Nov 10, 2021
1 parent 5ab40bd commit 24af9ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cli/test/org/partiql/cli/functions/ReadFileTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ class ReadFileTest {
assertEquals(ion.singleValue(expected), actual)
}

@Test
fun readCsvWithIonSymbolAsInput() {
writeFile("data_with_ion_symbol_as_input.csv", "1,2")

val args = listOf("\"${dirPath("data_with_ion_symbol_as_input.csv")}\"", "{type:csv}").map { it.exprValue() }

val actual = function.call(env, args).ionValue
val expected = "[{_1:\"1\",_2:\"2\"}]"

assertEquals(ion.singleValue(expected), actual)
}

@Test
fun readCsvWithDoubleQuotesEscape() {
writeFile("data_with_double_quotes_escape.csv", "\"1,2\",2")
Expand Down

0 comments on commit 24af9ed

Please sign in to comment.