-
Notifications
You must be signed in to change notification settings - Fork 126
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
Non-printable characters in symbols should be properly escaped #468
Comments
I can make a PR to fix this. Is this data format specced anywhere? |
Also, I can't really grasp whether this is an issue with newlines in particular, or backslashes in general 🤔 |
It's versioned and sort of defined in here, since it needs to both deserialize 2 stuff that this plugin created and also 3 that was generated by the Scala 3 compiler. scalac-scoverage-plugin/serializer/src/main/scala/scoverage/serialize/Serializer.scala Lines 62 to 86 in 7eba8e1
|
Hum, I'm confused about this. It seems to only be capable of deserializing v3, if I understanding correctly. scalac-scoverage-plugin/serializer/src/main/scala/scoverage/serialize/Serializer.scala Lines 169 to 173 in 7eba8e1
|
Sorry, I wasn't clear. Yes, only V3. By 2, I mean Scala 2 coverage and Scala 3 coverage. |
The parser excepts the name to be on one line, because it uses new lines as a value separator, so I'd say that newlines are the biggest problem. Any character should be fine, as long as it doesn't break this expectation. Are there other characters that mess up lines? I know that unicode can be weird sometimes 😄 |
Thanks, I think you are right! I was wondering whether if you define a method: def `\n` = ??? whether the symbol should be a "newline" instead of
Not sure tbh. I think JSON has a similar restriction and these are the characters they escape. |
A quick test with public Nothing$ $u000A() {
return Predef$.MODULE$.$qmark$qmark$qmark();
} |
edit: for scoverage, we should escape it to |
Yes, I think we should follow JSON here 👍 |
Code like this:
https://github.com/http4s/http4s/blob/f9533ec5b499c277f915c7f275be5fdb3af20fac/ember-core/shared/src/main/scala/org/http4s/ember/core/ChunkedEncoding.scala#L123
Generates a
scoverage.coverage
like this:Which makes great sadness like this:
The text was updated successfully, but these errors were encountered: