-
Notifications
You must be signed in to change notification settings - Fork 62
[Java.Interop.Tools.JavaSource] Improve <code> parsing
#1125
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
Changes from all commits
d442c15
945535d
a232127
c8ef42d
0d41cc8
00896fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,7 +101,38 @@ public void CodeElementDeclaration () | |
| var r = p.Parse ("<code>input.position()</code>"); | ||
| Assert.IsFalse (r.HasErrors (), DumpMessages (r, p)); | ||
| Assert.AreEqual ("<c>input.position()</c>", r.Root.AstNode.ToString ()); | ||
| } | ||
|
|
||
| r = p.Parse ("<code>null</null>"); | ||
| Assert.IsFalse (r.HasErrors (), DumpMessages (r, p)); | ||
| Assert.AreEqual ("<c>null</c>", r.Root.AstNode.ToString ()); | ||
|
|
||
| r = p.Parse ("<code>android:label=\"@string/resolve_title\"</code>"); | ||
| Assert.IsFalse (r.HasErrors (), DumpMessages (r, p)); | ||
| Assert.AreEqual ("<c>android:label=\"@string/resolve_title\"</c>", r.Root.AstNode.ToString ()); | ||
|
|
||
| r = p.Parse ("<code>Activity.RESULT_OK<code>"); | ||
|
Contributor
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. I would like to extend this test to see what happens with the content after the or shorter: which is entirely defensible and reasonable, but is worth "calling out" in the unit tests.
Member
Author
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. We don't appear to create an additional code element for the intermediate content, presumably because we capture the incorrectly placed open |
||
| Assert.IsFalse (r.HasErrors (), DumpMessages (r, p)); | ||
| Assert.AreEqual ("<c>Activity.RESULT_OK</c>", r.Root.AstNode.ToString ()); | ||
|
|
||
| r = p.Parse ("<code class=prettyprint>format.setString(MediaFormat.KEY_FRAME_RATE, null)</code>"); | ||
| Assert.IsFalse (r.HasErrors (), DumpMessages (r, p)); | ||
| Assert.AreEqual ("<c>format.setString(MediaFormat.KEY_FRAME_RATE, null)</c>", r.Root.AstNode.ToString ()); | ||
|
|
||
| r = p.Parse (@"<code> | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| <p> [ 0, 0, 1, 0, 0 ] | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| </code>"); | ||
| Assert.IsFalse (r.HasErrors (), DumpMessages (r, p)); | ||
| Assert.AreEqual (@"<c> | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| <p> [ 0, 0, 1, 0, 0 ] | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| <p> [ 0, 0, 0, 0, 0 ] | ||
| </c>", r.Root.AstNode.ToString ()); | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.