Skip to content

can't write test case if the testcase contains escape char #562

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

Open
tongluyang opened this issue May 30, 2020 · 0 comments
Open

can't write test case if the testcase contains escape char #562

tongluyang opened this issue May 30, 2020 · 0 comments

Comments

@tongluyang
Copy link

🐛 Bug Report

I test my code by "Write directly"

the testcase is

"dir\\n\\tsubdir1\\n\\tsubdir2\\n\\t\\tfile.ext"

it have some '\n'

I want submit '\n' to leetcode, but it eaten by the extension, and I got an error

Error

com.eclipsesource.json.ParseException: Expected valid escape sequence at 1:6
at line 379, com.eclipsesource.json.JsonParser.error
at line 372, com.eclipsesource.json.JsonParser.expected
at line 250, com.eclipsesource.json.JsonParser.readEscape
at line 202, com.eclipsesource.json.JsonParser.readStringInternal
at line 193, com.eclipsesource.json.JsonParser.readString
at line 90, com.eclipsesource.json.JsonParser.readValue
at line 121, com.eclipsesource.json.JsonParser.readArray
at line 92, com.eclipsesource.json.JsonParser.readValue
at line 73, com.eclipsesource.json.JsonParser.parse
at line 126, com.eclipsesource.json.JsonValue.readFrom
at line 133, com.eclipsesource.json.JsonArray.readFrom
at Deserializer.toString(Unknown Source)
at line 82, Driver.main

Your Input

"dir\
\\tsubdir1\
\\tsubdir2\
\\t\\tfile.ext"

To Reproduce

1、leetcode, No. 388 https://leetcode-cn.com/problems/longest-absolute-file-path/description/
2、test code, Testcase Example: "dir\\n\\tsubdir1\\n\\tsubdir2\\n\\t\\tfile.ext"
3、error

also i try to change the testcase to "dir\\\\n\\\\tsubdir1\\\\n\\\\tsubdir2\\\\n\\\\t\\\\tfile.ext"

then I got a response
Your Input

"dir\\\
\\\\tsubdir1\\\
\\\\tsubdir2\\\
\\\\t\\\\tfile.ext"

Expected behavior

escape '\n'

Extension Output

Paste here the LeetCode extension log from output channel.

  • Waiting for judge result
    × Runtime Error
    × Error: com.eclipsesource.json.ParseException: Expected valid escape sequence at 1:6
    at line 379, com.eclipsesource.json.JsonParser.error
    at line 372, com.eclipsesource.json.JsonParser.expected
    at line 250, com.eclipsesource.json.JsonParser.readEscape
    at line 202, com.eclipsesource.json.JsonParser.readStringInternal
    at line 193, com.eclipsesource.json.JsonParser.readString
    at line 90, com.eclipsesource.json.JsonParser.readValue
    at line 121, com.eclipsesource.json.JsonParser.readArray
    at line 92, com.eclipsesource.json.JsonParser.readValue
    at line 73, com.eclipsesource.json.JsonParser.parse
    at line 126, com.eclipsesource.json.JsonValue.readFrom
    at line 133, com.eclipsesource.json.JsonArray.readFrom
    at Deserializer.toString(Unknown Source)
    at line 82, Driver.main
    × Your Input: "dir
    \tsubdir1
    \tsubdir2
    \t\tfile.ext"
    × Stdout:

Your Environment

  • os: win10
  • extension settings: Default except "leetcode.endpoint": "leetcode-cn", "leetcode.showCommentDescription": true
  • nodejs version: v10.15.3
  • vscode version: 1.45.1
  • extension version: 0.16.2
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

1 participant