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

The test cases cannot have quotes (") #60

Closed
Licheng-Xu opened this issue Aug 19, 2018 · 8 comments
Closed

The test cases cannot have quotes (") #60

Licheng-Xu opened this issue Aug 19, 2018 · 8 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Licheng-Xu
Copy link

尝试使用 "00000" 或者 "00000" 都不行

@jdneo
Copy link
Member

jdneo commented Aug 20, 2018

Hi @Licheng-Xu

可以提供一下题号吗?

@jdneo jdneo added the help wanted Extra attention is needed label Aug 24, 2018
@Licheng-Xu
Copy link
Author

不好意思,这几天忙着其他事情了。

题号:[13]
Roman to Integer

选择直接输入测试样例,输入 "LVIII",之后返回了

Input data:
LVIII

Actual
× Runtime Error
× runtime: N/A
× answer:
× stdout: ''
× error: terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid

Expected
× Runtime Error
× runtime: N/A
× answer:
× stdout: ''
× error: Line 68: ValueError: No JSON object could be decoded

@jdneo
Copy link
Member

jdneo commented Sep 1, 2018

@Licheng-Xu It looks like a bug. Thank you for the feedback. 👍

@jdneo jdneo self-assigned this Sep 1, 2018
@jdneo jdneo added bug Something isn't working and removed help wanted Extra attention is needed labels Sep 1, 2018
@jdneo jdneo changed the title 请问当测试样例为字符串的时候,如何输入测试样例 The test cases cannot have quotes (") Sep 1, 2018
@LiuLiC
Copy link

LiuLiC commented Nov 23, 2018

Hi @jdneo , looks like the bug happened because in test.ts: when we get the test string, we replace all /" with "", which drops quotes. Thus in leetcode, it can't recognize the input as a string.

@jdneo
Copy link
Member

jdneo commented Nov 29, 2018

@LiuLiC Yeah, I know that. Because I remember that there is a problem if we do not do the replacement.

Not quite sure how the current status is. PR is welcome if you are willing to fix this. 😄

@jdneo
Copy link
Member

jdneo commented Feb 9, 2019

Fixed in #111.

Will get released in 0.10.2

@jdneo
Copy link
Member

jdneo commented Feb 10, 2019

Hmm...

Actually, this bug is not well fixed in #111. I did some experiments on different platforms and found that the test string needs to be parsed in different ways:

Bash (Mac)

'"XX"'

CMD (Windows)

"\"XX\""

PowerShell (Windows)

'\"XX\"'

I have no Linux machine to verify, but guess the behavior should be similar with that in Bash.

So I created another PR: #113, to fix it.

@jdneo
Copy link
Member

jdneo commented Feb 15, 2019

@ALL 0.10.2 has been released with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants