Julia: 为≈测试失败添加特殊显示

创建于 2017-01-06  ·  3评论  ·  资料来源: JuliaLang/julia

正如@cstjeanhttps://github.com/JuliaLang/julia/pull/19880 中指出的那样<strong i="7">@test</strong> a ≈ b<strong i="9">@test_approx_eq</strong> a b不同之处在于前者不能很好地显示测试失败。 我们已经有专门的代码来很好地显示某些类型的比较,所以也许我们应该在那里有更多的逻辑来像@test_approx_eq那样很好地显示近似相等失败。

Hacktoberfest display and printing help wanted testsystem

最有用的评论

所有3条评论

@StefanKarpinski我想在这方面工作。 关于要做什么的更多信息?

julia> using Test

julia> <strong i="5">@test</strong> 2.1 ≈ 1+1
Test Failed at REPL[2]:1
  Expression: 2.1 ≈ 1 + 1
   Evaluated: 2.1 ≈ 2
ERROR: There was an error during testing

julia> <strong i="6">@test</strong> 2.1 == 1+1
Test Failed at REPL[3]:1
  Expression: 2.1 == 1 + 1
   Evaluated: 2.1 == 2
ERROR: There was an error during testing

看起来现在找到主人了吗?

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

m-j-w picture m-j-w  ·  3评论

StefanKarpinski picture StefanKarpinski  ·  3评论

omus picture omus  ·  3评论

tkoolen picture tkoolen  ·  3评论

wilburtownsend picture wilburtownsend  ·  3评论