5

如何将 SUnit(或 phexample)中的单元测试标记为预期失败?

4

1 回答 1

4

在您的测试中覆盖 expectedFailures。WeakSetTest 中有一个例子:

expectedFailures
    "such tests work in Squeak"
    ^ #(testDoAfter testIncludes )

更新:

从 Pharo 1.2 开始,您还可以在测试方法中添加一个编译指示:

testDontWork
    <expectedFailure>
    self assert: 3 equals: 4
于 2010-10-20T10:04:42.613 回答