JuliaTesting / ReferenceTests.jl

Utility package for comparing data against reference files
https://juliatesting.github.io/ReferenceTests.jl/latest/
Other
82 stars 14 forks source link

Split up test_reference into ~3 smaller functions #80

Open oxinabox opened 3 years ago

oxinabox commented 3 years ago

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.