在Intellij Idea中调试时,在评估表达对话框中无法访问SPOCK测试的变量
在以下SPOCK测试中:
def 'simple assertion'() {
expect:
Math.max(a, b) == max
where:
a | b | max
3 | 5 | 5
4 | 9 | 9
}
在预期块上设置代码行中的断点时,无法访问变量的值(a,b)在调试时。返回的异常是:
groovy.lang.MissingPropertyException: No such property: a, b for class: DUMMY
围绕它的唯一方法是手动从中复制数据,其中
零件中的一部分纳入评估表达式对话框中。
我如何使用评估表达式而无需手动从中复制一个测试的一部分的值?
我使用的是Intellij Idus Ultimate 2022.1在MacOS 12 Monterey上运行的Groovy版本4,而Gradle作为构建工具。
In the following Spock test:
def 'simple assertion'() {
expect:
Math.max(a, b) == max
where:
a | b | max
3 | 5 | 5
4 | 9 | 9
}
When setting a breakpoint in the code line at the expect block, it is not possible to access the value of the variables (a, b)
from the Evaluate Expression... dialog while debugging. The returned exception is:
groovy.lang.MissingPropertyException: No such property: a, b for class: DUMMY
The only way around it is by manually copying the data from the where
part into the evaluate expression dialog.
How can I use evaluate expression WITHOUT having to manually copy the values from the where
part of the test?
I am using IntelliJ IDEA Ultimate 2022.1 running on macOS 12 Monterey with Groovy version 4 and Gradle as a build tool.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我明确声明参数时,它对我有用。
It worked for me when I declared the parameters explicitly.