fix(接口测试): 变量断言正则匹配,带有特殊字符,匹配失败

--bug=1039695 --user=陈建星 【接口测试】定义-断言-值为josn和list断言失败 https://www.tapd.cn/55049933/s/1500728
This commit is contained in:
AgAngle 2024-04-18 14:40:11 +08:00 committed by 刘瑞斌
parent 6426d1429d
commit f17a1c0e77
1 changed files with 1 additions and 1 deletions

View File

@ -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;
"""); """);