空手道-有没有办法将字符串与字符串列表匹配?

苏拉卜·查帕里(Sourabh Chapali)

回应:

{
name : 'Sourabh'
}

实施验证:

And match $.name contains any ['Sourabh','Peter','Babu']

上面的验证失败,如何匹配值(值列表中的任何元素)

巴布·塞卡兰

验证这一点的方法不止一种,我在举一个工作示例。

* def response = {name : 'Sourabh'}
* def expectedList = ['Sourabh','Peter','Babu']
* match response.name == "#string? expectedList.indexOf(_) != -1"

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章