2424import java .net .URISyntaxException ;
2525import java .nio .file .Files ;
2626import java .nio .file .Path ;
27+ import java .util .regex .Pattern ;
2728
2829import org .junit .jupiter .api .Test ;
2930import org .junit .jupiter .api .io .TempDir ;
@@ -75,9 +76,9 @@ void writesValidXmlReport() throws Exception {
7576 <java:javaVersion>${xmlunit.ignore}</java:javaVersion>
7677 <java:fileEncoding>${xmlunit.ignore}</java:fileEncoding>
7778 <java:heapSize max="${xmlunit.isNumber}"/>
78- <git:repository originUrl="${xmlunit.matchesRegex( https://.+) }"/>
79+ <git:repository originUrl="${xmlunit.matchesRegex#(git@| https://).+# }"/>
7980 <git:branch>${xmlunit.ignore}</git:branch>
80- <git:commit>${xmlunit.matchesRegex( [0-9a-f]{40}) }</git:commit>
81+ <git:commit>${xmlunit.matchesRegex# [0-9a-f]{40}# }</git:commit>
8182 <git:status clean="${xmlunit.ignore}">${xmlunit.ignore}</git:status>
8283 </infrastructure>
8384 <e:started id="1" name="dummy" time="${xmlunit.isDateTime}">
@@ -104,7 +105,7 @@ void writesValidXmlReport() throws Exception {
104105 <e:finished id="2" time="${xmlunit.isDateTime}">
105106 <result status="FAILED">
106107 <java:throwable assertionError="true" type="org.opentest4j.AssertionFailedError">
107- ${xmlunit.matchesRegex( org\\ .opentest4j\\ .AssertionFailedError: failure message) }
108+ ${xmlunit.matchesRegex# org\\ .opentest4j\\ .AssertionFailedError: failure message# }
108109 </java:throwable>
109110 </result>
110111 </e:finished>
@@ -115,7 +116,8 @@ void writesValidXmlReport() throws Exception {
115116 """ ;
116117
117118 XmlAssert .assertThat (xmlFile ).and (expected ) //
118- .withDifferenceEvaluator (new PlaceholderDifferenceEvaluator ()) //
119+ .withDifferenceEvaluator (new PlaceholderDifferenceEvaluator (Pattern .quote ("${" ), Pattern .quote ("}" ),
120+ Pattern .quote ("#" ), Pattern .quote ("#" ), "," )) //
119121 .ignoreWhitespace () //
120122 .areIdentical ();
121123 }
0 commit comments