【问题标题】:Nimble - expect to equal <0.9602>, got <0.9602>Nimble - 期望等于 <0.9602>,得到 <0.9602>
【发布时间】:2016-10-04 13:29:18
【问题描述】:

我的项目是用 Swift 2.0 编写的,我使用 Quick & Nimble 来测试我的代码。

expect(workerSpy.buySharesQuantity).to(equal(0.9602))

我得到的是错误消息的预期失败

expected to equal <0.9602>, got <0.9602>

buySharesQuantity 的定义

var buySharesQuantity: Double = 0.0

有人知道为什么吗?

【问题讨论】:

    标签: swift testing nimble quick-nimble


    【解决方案1】:

    您应该使用beCloseTo 而不是equal

    更多关于为什么here

    【讨论】:

      猜你喜欢
      • 2014-09-08
      • 1970-01-01
      • 2011-05-22
      • 1970-01-01
      • 2019-04-16
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 2021-01-09
      相关资源
      最近更新 更多