You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val format = new DefaultCSVFormat {
override val quoteChar: Char = 'd'
override val delimiter: Char = 'u'
override val escapeChar: Char = 'e'
}
I'll write this in pseudocode to keep things simple:
csv.write(format, List("foo", "true")) === "fooudtrued"
csv.read(format, "fooudtrued") === -\/("Malformed input")
// This works
csv.read(format, "fooudtrueed") === \/-(List("foo", "true"))
I am not sure whether the writer is at fault for not escaping the escape character or if it's the parser which should not interpret the escape character as such inside of a quote.
This might seem like a little bit of an academic exercise given the unlikely csv format, but it's causing test failures for us since we have scalacheck properties that generate arbitrary CSVFormat.
I can submit a pull request with a scalacheck property that makes sure that for any Arbitrary[List[List[String]]] and Arbitrary[CSVFormat], data == read(write(data)) is true, but as mentioned in my example above, I'm not sure whether the fix should be in the Parser or the Writer.
The text was updated successfully, but these errors were encountered:
Example of an offending scenario:
Given the following csv format:
I'll write this in pseudocode to keep things simple:
I am not sure whether the writer is at fault for not escaping the escape character or if it's the parser which should not interpret the escape character as such inside of a quote.
This might seem like a little bit of an academic exercise given the unlikely csv format, but it's causing test failures for us since we have scalacheck properties that generate arbitrary
CSVFormat
.I can submit a pull request with a scalacheck property that makes sure that for any
Arbitrary[List[List[String]]]
andArbitrary[CSVFormat]
,data == read(write(data))
is true, but as mentioned in my example above, I'm not sure whether the fix should be in theParser
or theWriter
.The text was updated successfully, but these errors were encountered: