代码之家  ›  专栏  ›  技术社区  ›  nes1983

如何在Sunit中标记预期故障?

  •  5
  • nes1983  · 技术社区  · 14 年前

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

    1 回复  |  直到 14 年前
        1
  •  4
  •   nes1983    14 年前

    覆盖测试中的预期故障。Weaksetest中有一个例子:

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

    更新:

    As of Pharo 1.2 ,还可以向测试方法添加一个pragma:

    testDontWork
        <expectedFailure>
        self assert: 3 equals: 4