-
Notifications
You must be signed in to change notification settings - Fork 19
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
Unicode Decoding in String/Char Literal Evaluation #113
Closed
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
63e44ba
SVN trunk now is for upcoming v2.2 release
9e6ed9e
test case for issue #60
c95061d
fixes issue#57
c53f3c8
fixes issue#67
c51542b
Fix some compiler warnings.
21650ca
Issue 72
951b52e
Issue 73
1576ffa
test case for issue#24
762e606
issue#17
a22dbfb
fixes issue#69
102e80e
fixes issue#66
bbab002
issue #77: NullPointerException by calling getAllNames() after parsin…
ed8801f
issue #79. Root cause exception in class initialization is converted …
da29288
Issue #82: unary operation (++/--) fails on float/double type.
9413c50
fixes issue#85
4df454b
issue #88
d52c659
Create README.md
pejobo 7991663
documentation updates
jodeleit-es 407bfc4
fixed issue links
jodeleit-es 159c4ea
release 2.19
pejobo 5c2393e
release 2.1.9
jodeleit-es 9d07af0
remove release-candidate jar
jodeleit-es 0ed0336
fixed release date
jodeleit-es 0893c3c
Add .gitignore
2650af7
String/Char Literal: decode unicode in specific scope, not in global …
de86211
String/Char Literal: add test cases
375c1d9
Update .gitignore
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,18 @@ public void parse_long_string_literal_multiline() throws Exception { | |
assertStringParsing("test\ntest", DelimiterMode.MULTI_LINE); | ||
} | ||
|
||
@Test | ||
public void parse_unicode_literals_in_comment() throws Exception { | ||
final Interpreter interpreter = new Interpreter(); | ||
Object result = interpreter.eval("// source path: C:\\user\\desktop"); | ||
Assert.assertEquals(result, null); | ||
char c = (char) interpreter.eval("return '\\u51ea\'"); | ||
Assert.assertEquals(c, '\u51ea'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test case two (dedicated method) |
||
String s = (String) interpreter.eval("return \"\\u51EA1234\"; // \\user\\desktop"); | ||
System.out.println(s); | ||
Assert.assertEquals(s, "\u51EA1234"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test case three (dedicated method) |
||
} | ||
|
||
|
||
private void assertStringParsing(final String s, final DelimiterMode mode) throws EvalError { | ||
assertStringParsing(s, s, mode); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case one (dedicated method)