作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
似乎我无法从 Kotlintest v3.4.2 访问 shouldMatchJson
匹配器,方法记录在 https://github.com/kotlintest/kotlintest/blob/master/doc/matchers.md 中.我得到 Unresolved reference ,我似乎无法导入它。代码说它是 String 类的扩展方法,但尝试使用字符串甚至 """{}"""但无法访问该方法。难道我做错了什么?所有其他匹配器都可以。
class Test : StringSpec ({
"Test a json" {
"{}".shouldMatchJson("{}")
}
})
最佳答案
可能是您缺少 json 扩展的导入?
我的 build.gradle 中有这个:
testImplementation "io.kotlintest:kotlintest-assertions-json:3.4.2"
关于testing - Kotlintest - Unresolved 引用 shouldMatchJson,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58343038/
似乎我无法从 Kotlintest v3.4.2 访问 shouldMatchJson 匹配器,方法记录在 https://github.com/kotlintest/kotlintest/blob/
我是一名优秀的程序员,十分优秀!