Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleArrayUtils.mkString/fromString have inconsistent behaviour #580

Closed
yakivy opened this issue Aug 23, 2022 · 1 comment
Closed

SimpleArrayUtils.mkString/fromString have inconsistent behaviour #580

yakivy opened this issue Aug 23, 2022 · 1 comment

Comments

@yakivy
Copy link

yakivy commented Aug 23, 2022

Description:
If you try to serialize escaped new line (\\n) with SimpleArrayUtils.mkString and deserialize with SimpleArrayUtils.fromString, the result will not have n

Prerequisites:

scala `2.13.8`
lib ivy"com.github.tminglei::slick-pg:0.20.3"

Minimal example:

import com.github.tminglei.slickpg.utils.SimpleArrayUtils
val input = List("Test \\n")
val result = SimpleArrayUtils.fromString[String](identity)(
    SimpleArrayUtils.mkString[String](identity)(input)
).orNull
assert(result == input) //List("Test \") did not equal List("Test \n")
@tminglei
Copy link
Owner

@yakivy fixed. Thanks for pointing it out! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants