如何在SUnit中标记预期的失败?

nes*_*983 5 unit-testing smalltalk pharo

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

nes*_*983 4

覆盖测试中的预期失败。WeakSetTest中有一个例子:

expectedFailures
    "such tests work in Squeak"
    ^ #(testDoAfter testIncludes )
Run Code Online (Sandbox Code Playgroud)

更新:

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

testDontWork
    <expectedFailure>
    self assert: 3 equals: 4
Run Code Online (Sandbox Code Playgroud)