FactCheck.jl icon indicating copy to clipboard operation
FactCheck.jl copied to clipboard

Erroring in facts block when not wrapped with @fact

Open karanveerm opened this issue 10 years ago • 3 comments

Consider a case like this:

foo() = 1 + "0"
facts("Testing") do
    foo()
    @fact 1 => 1
    @fact 2 => 3
    @fact 3 => 3
    @fact 4 => 4
    @fact 5 => 5
end

This will still throw an error since foo() will throw an error and the remaining lines won't execute. My main use case for FactCheck is that tests keep running even if a single line fails. Would you consider the best way to go about this being to do something like @fact foo() => anything or would it make sense to change the implementation of FactCheck such that if there is an error in the facts block, other facts blocks continue running? Thanks!

karanveerm avatar Jan 16 '15 00:01 karanveerm

Thats an interesting idea, I'll have to think about that one!

IainNZ avatar Jan 16 '15 18:01 IainNZ

I strongly support the suggested behavior.

greenflash1357 avatar Nov 24 '15 10:11 greenflash1357

Base.Test in Julia 0.5, or equivalently BaseTestNext https://github.com/IainNZ/BaseTestNext.jl if you're on 0.4, implements this

IainNZ avatar Nov 24 '15 14:11 IainNZ