Visitar URL original
add support for matchesRegex placeholder by Jazzyekim · Pull Request #178 · xmlunit/xmlunit · GitHub
Skip to content

add support for matchesRegex placeholder - #178

Merged
bodewig merged 1 commit into
xmlunit:masterfrom
Jazzyekim:placeholder-regex
May 6, 2020
Merged

bodewig merged 1 commit into
xmlunit:masterfrom
Jazzyekim:placeholder-regex

Conversation

@Jazzyekim

Copy link
Copy Markdown

Introduce the implementation of matchesRegex placeholders. Need that functionality on the project I am working on. I decided to share my implementation with you as a PR
Since this placeholder contains a parameter I had to extend the signature of evaluate method to support parameters as optional array of strings.

@coveralls

coveralls commented Mar 24, 2020 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 91.808% when pulling fea1758 on Jazzyekim:placeholder-regex into 4866621 on xmlunit:master.

@bodewig

bodewig commented Apr 20, 2020

Copy link
Copy Markdown
Member

Many thanks @Jazzyekim this looks interesting. It may also help #174 in a way.

Actually when I looked at your code first I wanted to see whether we could get away without breaking the interface with the help of default methods - even if that meant to move on to Java 8 for the placeholders project. Unfortunately I haven't found the time to try this out, yet.

@bodewig bodewig added this to the 2.6.5 milestone May 4, 2020
@bodewig
bodewig merged commit ee476a2 into xmlunit:master May 6, 2020
bodewig added a commit that referenced this pull request May 6, 2020
the module has been marked as experimental so making backwards
incompatible changes should be fine, but still we should at least do a
minor release for this.

see #178
bodewig added a commit that referenced this pull request May 6, 2020
@bodewig

bodewig commented May 6, 2020

Copy link
Copy Markdown
Member

@Jazzyekim many thanks

I've rewritten PlaceholderDifferenceEvaluators argument list parsing a bit in order to make it more configurable in 22b014a - at least the existing tests still pass, except I had to change the one about the bad regex as the changed code would use the second parenthesis as opening the argument list and not cause any problem because the keyword then wouldn't match.

@Jazzyekim

Copy link
Copy Markdown
Author

@bodewig, glad to hear that you found it useful! Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants