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

Split up test_reference into ~3 smaller functions

Open oxinabox opened this issue 4 years ago • 0 comments

test_reference is like 50 lines long. https://github.com/JuliaTesting/ReferenceTests.jl/blob/f26bec0c8ec86cbf3c3d207884cfc90b64033e6b/src/test_reference.jl#L93-L150

And it is even longer when i put in the stuff for #79

I think we should have it more like

function test_reference(
    file::File{F},
    raw_actual::T,
    equiv=nothing,
    rendermode=nothing;
    kw...) where {F <: DataFormat, T}

    actual = ...
    rendermode = ...

    if !isfile(path)
        handle_nonexisting_reference(...)
    else
        test_against_reference(...)
    end
end

splitting the two main branchs out. Possible workout out the equiv should be done in the main function, then all the modal stuff is done there.

oxinabox avatar Feb 20 '21 14:02 oxinabox