fixup unittests and handling of non-element nodes in <include>, <if>, <macro>#48
Merged
codebot merged 5 commits intoros:indigo-develfrom Feb 19, 2015
Merged
Conversation
- so far only element nodes (with its attributes) were considered - now also consider TEXT, CDATA, and COMMENT nodes - added function text_matches (normalizing consecutive whitespace to a single space) added some new unit tests - test_consider_non_elements: non-element nodes are not yet considered in <if> and <macro>
-> print all text, but skip whitespace-only text nodes
New handling of non-element nodes invalidates pr2 gold standard (adding a lot more comments). To allow validation, allow to ignore all comments in comparison (as before).
Contributor
|
Thank you for these improvements. I think everybody was already expecting things to behave like this, and (for whatever reason) these bugs were not noticed yet. It's interesting how the "new" PR2 example has all of the top-level included comments plastered at the beginning of the file. I guess that is due to the non-ordered processing of include files, which you fixed in the next pull request. |
codebot
added a commit
that referenced
this pull request
Feb 19, 2015
fixup unittests and handling of non-element nodes in <include>, <if>, <macro>
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Non-element nodes in
<include>,<if>,<macro>tags were not copied. This was not noticed, because unittesting didn't consider non-element nodes either. Hence,elements_match(a,b)bynodes_match(a,b), consideringtext,cdata, andcommentnodes and their content. (8dfa543)<if>and<macro>. (8dfa543)The new handling of non-element nodes, invalidates the pr2 gold standard, because a lot more comments are maintained. To allow proper validation, modified
nodes_match(a,b)to ignore comments again (394b8e6).Finally, updated the pr2 gold standard and disabled ignoring of comments (59605fb).