fix(接口测试): 变量断言正则匹配,带有特殊字符,匹配失败
--bug=1039695 --user=陈建星 【接口测试】定义-断言-值为josn和list断言失败 https://www.tapd.cn/55049933/s/1500728
This commit is contained in:
parent
6426d1429d
commit
f17a1c0e77
|
@ -81,7 +81,7 @@ public class VariableAssertionConverter extends AssertionConverter<MsVariableAss
|
||||||
handleMap.put(MsAssertionCondition.REGEX.name(),
|
handleMap.put(MsAssertionCondition.REGEX.name(),
|
||||||
"""
|
"""
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
result = Pattern.matches(expectation, variableValue);
|
result = Pattern.matches(Pattern.quote(expectation), variableValue);
|
||||||
msg = variableValue + " not matching " + expectation;
|
msg = variableValue + " not matching " + expectation;
|
||||||
""");
|
""");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue