Skip to content

Commit a3f6bad

Browse files
test matcher with expected assign symbols having special chars inside their names
1 parent f9eaa24 commit a3f6bad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/io/jtest/utils/matcher/StringMatcherTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ public void compareSimpleStringWithAssignSymbols() throws InvalidTypeException {
174174
assertEquals(2, symbols.size());
175175
}
176176

177+
@Test
178+
public void compareSimpleStringWithSpecialCharsAssignSymbols() throws InvalidTypeException {
179+
String expected = "This is ~[color.var-with!special[na-me<>{}\":;'/.,?'] color";
180+
String actual = "This is blue black color";
181+
StringMatcher matcher = new StringMatcher(null, expected, actual, null);
182+
Map<String, Object> symbols = matcher.match();
183+
assertEquals("blue black", symbols.get("color.var-with!special[na-me<>{}\":;'/.,?'"));
184+
}
185+
177186
@Test
178187
public void compareRegexWithAssignSymbols() throws InvalidTypeException {
179188
String expected = ".* Rabbit ~[sym1] in the .*";

0 commit comments

Comments
 (0)