diff --git a/src/render.jl b/src/render.jl index c7e7d48..9c4e5d2 100644 --- a/src/render.jl +++ b/src/render.jl @@ -9,57 +9,57 @@ struct BeforeAfterLimited <: BeforeAfter end struct BeforeAfterFull <: BeforeAfter end struct BeforeAfterImage <: BeforeAfter end -render_item(::RenderMode, item) = println(item) -function render_item(::BeforeAfterLimited, item) - show(IOContext(stdout, :limit=>true, :displaysize=>(20,80)), "text/plain", item) - println() +render_item(mode::RenderMode, item) = render_item(stdout, mode, item) +render_item(io::IO, ::RenderMode, item) = println(io, item) +function render_item(io::IO, ::BeforeAfterLimited, item) + show(IOContext(io, :limit=>true, :displaysize=>(20,80)), "text/plain", item) + println(io) end -function render_item(::BeforeAfterImage, item) +function render_item(io::IO, ::BeforeAfterImage, item::AbstractMatrix) + # FIXME: encodeimg only support 2d cases right now str_item = @withcolor ImageInTerminal.encodeimg(ImageInTerminal.SmallBlocks(), ImageInTerminal.TermColor256(), item, 20, 40)[1] - println("eltype: ", eltype(item)) - println("size: ", map(length, axes(item))) - println("thumbnail:") - println.(str_item) + println(io, "eltype: ", eltype(item)) + println(io, "size: ", map(length, axes(item))) + println(io, "thumbnail:") + foreach(x->println(io, x), str_item) end ## 2 arg form render for comparing -function render(mode::BeforeAfter, reference, actual) - println("- REFERENCE -------------------") - render_item(mode, reference) - println("-------------------------------") - println("- ACTUAL ----------------------") - render_item(mode, actual) - println("-------------------------------") +render(mode::RenderMode, args...) = render(stdout, mode, args...) +function render(io::IO, mode::BeforeAfter, reference, actual) + println(io, "- REFERENCE -------------------") + render_item(io, mode, reference) + println(io, "-------------------------------") + println(io, "- ACTUAL ----------------------") + render_item(io, mode, actual) + println(io, "-------------------------------") end -function render(::Diff, reference, actual) - println("- DIFF ------------------------") - @withcolor println(deepdiff(reference, actual)) - println("-------------------------------") +function render(io::IO, ::Diff, reference, actual) + println(io, "- DIFF ------------------------") + @withcolor println(io, deepdiff(reference, actual)) + println(io, "-------------------------------") end ## 1 arg form render for new content -function render(mode::RenderMode, actual) - println("- NEW CONTENT -----------------") - render_item(mode, actual) - println("-------------------------------") +function render(io::IO, mode::RenderMode, actual) + println(io, "- NEW CONTENT -----------------") + render_item(io, mode, actual) + println(io, "-------------------------------") end +# We set the fallback as limited mode because it is not safe/efficient to fully render anything unless +# * we have prior information that it is not long -- numbers +# * or, we know how to fully render it efficiently without sending too much noise to IO +# - Diff mode for strings +# - BeforeAfterImage for images +# Arrays, in general, should be rendered using limited mode. """ - default_rendermode(::DataFormat, actual) + default_rendermode(actual) -Infer the most appropriate render mode according to type of reference file and `actual`. +Infer the most appropriate render mode according to type of `actual`. """ -default_rendermode(::Type{<:DataFormat}, ::Any) = BeforeAfterLimited() -default_rendermode(::Type{<:DataFormat}, ::AbstractString) = Diff() -default_rendermode(::Type{<:DataFormat}, ::AbstractArray{<:Colorant}) = BeforeAfterImage() - -# plain TXTs -default_rendermode(::Type{DataFormat{:TXT}}, ::Any) = Diff() -default_rendermode(::Type{DataFormat{:TXT}}, ::AbstractString) = Diff() -default_rendermode(::Type{DataFormat{:TXT}}, ::Number) = BeforeAfterFull() -default_rendermode(::Type{DataFormat{:TXT}}, ::AbstractArray{<:Colorant}) = BeforeAfterImage() - -# SHA256 -default_rendermode(::Type{DataFormat{:SHA256}}, ::Any) = BeforeAfterFull() -default_rendermode(::Type{DataFormat{:SHA256}}, ::AbstractString) = BeforeAfterFull() -default_rendermode(::Type{DataFormat{:SHA256}}, ::AbstractArray{<:Colorant}) = BeforeAfterLimited() +default_rendermode(::Type) = BeforeAfterLimited() +default_rendermode(::Type{T}) where T<:Number = BeforeAfterFull() +default_rendermode(::Type{T}) where T<:AbstractString = Diff() +default_rendermode(::Type{T}) where T<:AbstractArray{<:AbstractString} = Diff() +default_rendermode(::Type{T}) where T<:AbstractArray{<:Colorant} = BeforeAfterImage() diff --git a/src/test_reference.jl b/src/test_reference.jl index f70873c..59319a9 100644 --- a/src/test_reference.jl +++ b/src/test_reference.jl @@ -103,9 +103,7 @@ function test_reference( # infer the default rendermode here # since `nothing` is always passed to this method from # test_reference(filename::AbstractString, raw_actual; kw...) - if rendermode === nothing - rendermode = default_rendermode(F, raw_actual) - end + rendermode === nothing && (rendermode = default_rendermode(T)) actual = maybe_encode(F, raw_actual; kw...) # preprocessing when reference file doesn't exists diff --git a/test/references/render/BeforeAfterFull/arr1_compare.txt b/test/references/render/BeforeAfterFull/arr1_compare.txt new file mode 100644 index 0000000..38d69c5 --- /dev/null +++ b/test/references/render/BeforeAfterFull/arr1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +[1 3 5 7; 2 4 6 8] +------------------------------- +- ACTUAL ---------------------- +[1 2 3 4 5 6 7 8] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/arr1_new.txt b/test/references/render/BeforeAfterFull/arr1_new.txt new file mode 100644 index 0000000..e1a3159 --- /dev/null +++ b/test/references/render/BeforeAfterFull/arr1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1 2 3 4 5 6 7 8] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/arr2_compare.txt b/test/references/render/BeforeAfterFull/arr2_compare.txt new file mode 100644 index 0000000..4b6758a --- /dev/null +++ b/test/references/render/BeforeAfterFull/arr2_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +[1, 3, 5, 7, 9, 11, 13, 15, 17, 19] +------------------------------- +- ACTUAL ---------------------- +[1, 4, 7, 10, 13, 16, 19] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/arr2_new.txt b/test/references/render/BeforeAfterFull/arr2_new.txt new file mode 100644 index 0000000..c7a1149 --- /dev/null +++ b/test/references/render/BeforeAfterFull/arr2_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1, 4, 7, 10, 13, 16, 19] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/arr3_compare.txt b/test/references/render/BeforeAfterFull/arr3_compare.txt new file mode 100644 index 0000000..380e3a5 --- /dev/null +++ b/test/references/render/BeforeAfterFull/arr3_compare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 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/arr3_new.txt b/test/references/render/BeforeAfterFull/arr3_new.txt new file mode 100644 index 0000000..6d4bc9f --- /dev/null +++ b/test/references/render/BeforeAfterFull/arr3_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 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fterFull/dataframe1_compare.txt new file mode 100644 index 0000000..9639669 --- /dev/null +++ b/test/references/render/BeforeAfterFull/dataframe1_compare.txt @@ -0,0 +1,18 @@ +- REFERENCE ------------------- +3×2 DataFrame +│ Row │ v1 │ v2 │ +│ │ Int64 │ String │ +├─────┼───────┼────────┤ +│ 1 │ 1 │ a │ +│ 2 │ 2 │ b │ +│ 3 │ 3 │ c │ +------------------------------- +- ACTUAL ---------------------- +3×2 DataFrame +│ Row │ v2 │ v1 │ +│ │ Int64 │ String │ +├─────┼───────┼────────┤ +│ 1 │ 1 │ a │ +│ 2 │ 2 │ b │ +│ 3 │ 3 │ c │ +------------------------------- diff --git a/test/references/render/BeforeAfterFull/dataframe1_new.txt b/test/references/render/BeforeAfterFull/dataframe1_new.txt new file mode 100644 index 0000000..9f1b3d4 --- /dev/null +++ b/test/references/render/BeforeAfterFull/dataframe1_new.txt @@ -0,0 +1,9 @@ +- NEW CONTENT ----------------- +3×2 DataFrame +│ Row │ v2 │ v1 │ +│ │ Int64 │ String │ +├─────┼───────┼────────┤ +│ 1 │ 1 │ a │ +│ 2 │ 2 │ b │ +│ 3 │ 3 │ c │ +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img1d_1_compare.txt b/test/references/render/BeforeAfterFull/img1d_1_compare.txt new file mode 100644 index 0000000..b80cc09 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img1d_1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +Gray{N0f8}[Gray{N0f8}(0.0), Gray{N0f8}(0.102), Gray{N0f8}(0.2), Gray{N0f8}(0.298), Gray{N0f8}(0.4), Gray{N0f8}(0.502), Gray{N0f8}(0.6), Gray{N0f8}(0.698), Gray{N0f8}(0.8), Gray{N0f8}(0.902)] +------------------------------- +- ACTUAL ---------------------- +Gray{N0f8}[Gray{N0f8}(0.902), Gray{N0f8}(0.8), Gray{N0f8}(0.698), Gray{N0f8}(0.6), Gray{N0f8}(0.502), Gray{N0f8}(0.4), Gray{N0f8}(0.298), Gray{N0f8}(0.2), Gray{N0f8}(0.102), Gray{N0f8}(0.0)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img1d_1_new.txt b/test/references/render/BeforeAfterFull/img1d_1_new.txt new file mode 100644 index 0000000..9b56d52 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img1d_1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +Gray{N0f8}[Gray{N0f8}(0.902), Gray{N0f8}(0.8), Gray{N0f8}(0.698), Gray{N0f8}(0.6), Gray{N0f8}(0.502), Gray{N0f8}(0.4), Gray{N0f8}(0.298), Gray{N0f8}(0.2), Gray{N0f8}(0.102), Gray{N0f8}(0.0)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img1d_2_compare.txt b/test/references/render/BeforeAfterFull/img1d_2_compare.txt new file mode 100644 index 0000000..cd23301 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img1d_2_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +Gray{N0f8}[Gray{N0f8}(0.0), Gray{N0f8}(0.102), Gray{N0f8}(0.2), Gray{N0f8}(0.298), Gray{N0f8}(0.4), Gray{N0f8}(0.502), Gray{N0f8}(0.6), Gray{N0f8}(0.698), Gray{N0f8}(0.8), Gray{N0f8}(0.902)] +------------------------------- +- ACTUAL ---------------------- +Gray{N0f8}[Gray{N0f8}(0.0), Gray{N0f8}(0.051), Gray{N0f8}(0.102), Gray{N0f8}(0.149), Gray{N0f8}(0.2), Gray{N0f8}(0.251), Gray{N0f8}(0.298), Gray{N0f8}(0.349), Gray{N0f8}(0.4), Gray{N0f8}(0.451), Gray{N0f8}(0.502), Gray{N0f8}(0.549), Gray{N0f8}(0.6), Gray{N0f8}(0.651), Gray{N0f8}(0.698), Gray{N0f8}(0.749), Gray{N0f8}(0.8), Gray{N0f8}(0.851), Gray{N0f8}(0.902), Gray{N0f8}(0.949)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img1d_2_new.txt b/test/references/render/BeforeAfterFull/img1d_2_new.txt new file mode 100644 index 0000000..d47cd0e --- /dev/null +++ b/test/references/render/BeforeAfterFull/img1d_2_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +Gray{N0f8}[Gray{N0f8}(0.0), Gray{N0f8}(0.051), Gray{N0f8}(0.102), Gray{N0f8}(0.149), Gray{N0f8}(0.2), Gray{N0f8}(0.251), Gray{N0f8}(0.298), Gray{N0f8}(0.349), Gray{N0f8}(0.4), Gray{N0f8}(0.451), Gray{N0f8}(0.502), Gray{N0f8}(0.549), Gray{N0f8}(0.6), Gray{N0f8}(0.651), Gray{N0f8}(0.698), Gray{N0f8}(0.749), Gray{N0f8}(0.8), Gray{N0f8}(0.851), Gray{N0f8}(0.902), Gray{N0f8}(0.949)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img1d_3_compare.txt b/test/references/render/BeforeAfterFull/img1d_3_compare.txt new file mode 100644 index 0000000..cb9a3ed --- /dev/null +++ b/test/references/render/BeforeAfterFull/img1d_3_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +RGB{N0f8}[RGB{N0f8}(0.0,0.0,0.0), RGB{N0f8}(0.102,0.102,0.102), RGB{N0f8}(0.2,0.2,0.2), RGB{N0f8}(0.298,0.298,0.298), RGB{N0f8}(0.4,0.4,0.4), RGB{N0f8}(0.502,0.502,0.502), RGB{N0f8}(0.6,0.6,0.6), RGB{N0f8}(0.698,0.698,0.698), RGB{N0f8}(0.8,0.8,0.8), RGB{N0f8}(0.902,0.902,0.902)] +------------------------------- +- ACTUAL ---------------------- +RGB{N0f8}[RGB{N0f8}(0.0,0.0,0.0), RGB{N0f8}(0.102,0.102,0.102), RGB{N0f8}(0.2,0.2,0.2), RGB{N0f8}(0.298,0.298,0.298), RGB{N0f8}(0.4,0.4,0.4), RGB{N0f8}(0.502,0.502,0.502), RGB{N0f8}(0.6,0.6,0.6), RGB{N0f8}(0.698,0.698,0.698), RGB{N0f8}(0.8,0.8,0.8), RGB{N0f8}(0.902,0.902,0.902)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img1d_3_new.txt b/test/references/render/BeforeAfterFull/img1d_3_new.txt new file mode 100644 index 0000000..9499dbc --- /dev/null +++ b/test/references/render/BeforeAfterFull/img1d_3_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +RGB{N0f8}[RGB{N0f8}(0.0,0.0,0.0), RGB{N0f8}(0.102,0.102,0.102), RGB{N0f8}(0.2,0.2,0.2), RGB{N0f8}(0.298,0.298,0.298), RGB{N0f8}(0.4,0.4,0.4), RGB{N0f8}(0.502,0.502,0.502), RGB{N0f8}(0.6,0.6,0.6), RGB{N0f8}(0.698,0.698,0.698), RGB{N0f8}(0.8,0.8,0.8), RGB{N0f8}(0.902,0.902,0.902)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img2d_1_compare.txt b/test/references/render/BeforeAfterFull/img2d_1_compare.txt new file mode 100644 index 0000000..d3d8d16 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img2d_1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +Gray{N0f8}[Gray{N0f8}(0.0) Gray{N0f8}(0.2) Gray{N0f8}(0.4) Gray{N0f8}(0.6) Gray{N0f8}(0.8); Gray{N0f8}(0.102) Gray{N0f8}(0.298) Gray{N0f8}(0.502) Gray{N0f8}(0.698) Gray{N0f8}(0.902)] +------------------------------- +- ACTUAL ---------------------- +Gray{N0f8}[Gray{N0f8}(0.902) Gray{N0f8}(0.698) Gray{N0f8}(0.502) Gray{N0f8}(0.298) Gray{N0f8}(0.102); Gray{N0f8}(0.8) Gray{N0f8}(0.6) Gray{N0f8}(0.4) Gray{N0f8}(0.2) Gray{N0f8}(0.0)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img2d_1_new.txt b/test/references/render/BeforeAfterFull/img2d_1_new.txt new file mode 100644 index 0000000..046eab4 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img2d_1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +Gray{N0f8}[Gray{N0f8}(0.902) Gray{N0f8}(0.698) Gray{N0f8}(0.502) Gray{N0f8}(0.298) Gray{N0f8}(0.102); Gray{N0f8}(0.8) Gray{N0f8}(0.6) Gray{N0f8}(0.4) Gray{N0f8}(0.2) Gray{N0f8}(0.0)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img3d_1_compare.txt b/test/references/render/BeforeAfterFull/img3d_1_compare.txt new file mode 100644 index 0000000..715e1c4 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img3d_1_compare.txt @@ -0,0 +1,26 @@ +- REFERENCE ------------------- +Gray{N0f8}[Gray{N0f8}(0.0) Gray{N0f8}(0.039) Gray{N0f8}(0.078) Gray{N0f8}(0.122); Gray{N0f8}(0.02) Gray{N0f8}(0.059) Gray{N0f8}(0.102) Gray{N0f8}(0.141)] + +Gray{N0f8}[Gray{N0f8}(0.161) Gray{N0f8}(0.2) Gray{N0f8}(0.239) Gray{N0f8}(0.278); Gray{N0f8}(0.18) Gray{N0f8}(0.22) Gray{N0f8}(0.259) Gray{N0f8}(0.298)] + +Gray{N0f8}[Gray{N0f8}(0.322) Gray{N0f8}(0.361) Gray{N0f8}(0.4) Gray{N0f8}(0.439); Gray{N0f8}(0.341) Gray{N0f8}(0.38) Gray{N0f8}(0.42) Gray{N0f8}(0.459)] + +Gray{N0f8}[Gray{N0f8}(0.478) Gray{N0f8}(0.522) Gray{N0f8}(0.561) Gray{N0f8}(0.6); Gray{N0f8}(0.502) Gray{N0f8}(0.541) Gray{N0f8}(0.58) Gray{N0f8}(0.62)] + +Gray{N0f8}[Gray{N0f8}(0.639) Gray{N0f8}(0.678) Gray{N0f8}(0.722) Gray{N0f8}(0.761); Gray{N0f8}(0.659) Gray{N0f8}(0.698) Gray{N0f8}(0.741) Gray{N0f8}(0.78)] + +Gray{N0f8}[Gray{N0f8}(0.8) Gray{N0f8}(0.839) Gray{N0f8}(0.878) Gray{N0f8}(0.922); Gray{N0f8}(0.82) Gray{N0f8}(0.859) Gray{N0f8}(0.902) Gray{N0f8}(0.941)] +------------------------------- +- ACTUAL ---------------------- +Gray{N0f8}[Gray{N0f8}(0.949) Gray{N0f8}(0.91) Gray{N0f8}(0.871) Gray{N0f8}(0.831); Gray{N0f8}(0.929) Gray{N0f8}(0.89) Gray{N0f8}(0.851) Gray{N0f8}(0.812)] + +Gray{N0f8}[Gray{N0f8}(0.788) Gray{N0f8}(0.749) Gray{N0f8}(0.71) Gray{N0f8}(0.671); Gray{N0f8}(0.769) Gray{N0f8}(0.729) Gray{N0f8}(0.69) Gray{N0f8}(0.651)] + +Gray{N0f8}[Gray{N0f8}(0.631) Gray{N0f8}(0.588) Gray{N0f8}(0.549) Gray{N0f8}(0.51); Gray{N0f8}(0.612) Gray{N0f8}(0.569) Gray{N0f8}(0.529) Gray{N0f8}(0.49)] + +Gray{N0f8}[Gray{N0f8}(0.471) Gray{N0f8}(0.431) Gray{N0f8}(0.388) Gray{N0f8}(0.349); Gray{N0f8}(0.451) Gray{N0f8}(0.412) Gray{N0f8}(0.369) Gray{N0f8}(0.329)] + +Gray{N0f8}[Gray{N0f8}(0.31) Gray{N0f8}(0.271) Gray{N0f8}(0.231) Gray{N0f8}(0.188); Gray{N0f8}(0.29) Gray{N0f8}(0.251) Gray{N0f8}(0.212) Gray{N0f8}(0.169)] + +Gray{N0f8}[Gray{N0f8}(0.149) Gray{N0f8}(0.11) Gray{N0f8}(0.071) Gray{N0f8}(0.031); Gray{N0f8}(0.129) Gray{N0f8}(0.09) Gray{N0f8}(0.051) Gray{N0f8}(0.012)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/img3d_1_new.txt b/test/references/render/BeforeAfterFull/img3d_1_new.txt new file mode 100644 index 0000000..e8969d6 --- /dev/null +++ b/test/references/render/BeforeAfterFull/img3d_1_new.txt @@ -0,0 +1,13 @@ +- NEW CONTENT ----------------- +Gray{N0f8}[Gray{N0f8}(0.949) Gray{N0f8}(0.91) Gray{N0f8}(0.871) Gray{N0f8}(0.831); Gray{N0f8}(0.929) Gray{N0f8}(0.89) Gray{N0f8}(0.851) Gray{N0f8}(0.812)] + +Gray{N0f8}[Gray{N0f8}(0.788) Gray{N0f8}(0.749) Gray{N0f8}(0.71) Gray{N0f8}(0.671); Gray{N0f8}(0.769) Gray{N0f8}(0.729) Gray{N0f8}(0.69) Gray{N0f8}(0.651)] + +Gray{N0f8}[Gray{N0f8}(0.631) Gray{N0f8}(0.588) Gray{N0f8}(0.549) Gray{N0f8}(0.51); Gray{N0f8}(0.612) Gray{N0f8}(0.569) Gray{N0f8}(0.529) Gray{N0f8}(0.49)] + +Gray{N0f8}[Gray{N0f8}(0.471) Gray{N0f8}(0.431) Gray{N0f8}(0.388) Gray{N0f8}(0.349); Gray{N0f8}(0.451) Gray{N0f8}(0.412) Gray{N0f8}(0.369) Gray{N0f8}(0.329)] + +Gray{N0f8}[Gray{N0f8}(0.31) Gray{N0f8}(0.271) Gray{N0f8}(0.231) Gray{N0f8}(0.188); Gray{N0f8}(0.29) Gray{N0f8}(0.251) Gray{N0f8}(0.212) Gray{N0f8}(0.169)] + +Gray{N0f8}[Gray{N0f8}(0.149) Gray{N0f8}(0.11) Gray{N0f8}(0.071) Gray{N0f8}(0.031); Gray{N0f8}(0.129) Gray{N0f8}(0.09) Gray{N0f8}(0.051) Gray{N0f8}(0.012)] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/num1_compare.txt b/test/references/render/BeforeAfterFull/num1_compare.txt new file mode 100644 index 0000000..387dce3 --- /dev/null +++ b/test/references/render/BeforeAfterFull/num1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +1 +------------------------------- +- ACTUAL ---------------------- +2 +------------------------------- diff --git a/test/references/render/BeforeAfterFull/num1_new.txt b/test/references/render/BeforeAfterFull/num1_new.txt new file mode 100644 index 0000000..44d5609 --- /dev/null +++ b/test/references/render/BeforeAfterFull/num1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +2 +------------------------------- diff --git a/test/references/render/BeforeAfterFull/str1_compare.txt b/test/references/render/BeforeAfterFull/str1_compare.txt new file mode 100644 index 0000000..5a1f9ce --- /dev/null +++ b/test/references/render/BeforeAfterFull/str1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +Hello world +------------------------------- +- ACTUAL ---------------------- +hello World +------------------------------- diff --git a/test/references/render/BeforeAfterFull/str1_new.txt b/test/references/render/BeforeAfterFull/str1_new.txt new file mode 100644 index 0000000..d41abdf --- /dev/null +++ b/test/references/render/BeforeAfterFull/str1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +hello World +------------------------------- diff --git a/test/references/render/BeforeAfterFull/str2_compare.txt b/test/references/render/BeforeAfterFull/str2_compare.txt new file mode 100644 index 0000000..4b6758a --- /dev/null +++ b/test/references/render/BeforeAfterFull/str2_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +[1, 3, 5, 7, 9, 11, 13, 15, 17, 19] +------------------------------- +- ACTUAL ---------------------- +[1, 4, 7, 10, 13, 16, 19] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/str2_new.txt b/test/references/render/BeforeAfterFull/str2_new.txt new file mode 100644 index 0000000..c7a1149 --- /dev/null +++ b/test/references/render/BeforeAfterFull/str2_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1, 4, 7, 10, 13, 16, 19] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/str3_compare.txt b/test/references/render/BeforeAfterFull/str3_compare.txt new file mode 100644 index 0000000..380e3a5 --- /dev/null +++ b/test/references/render/BeforeAfterFull/str3_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.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0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0] +------------------------------- diff --git a/test/references/render/BeforeAfterFull/str3_new.txt b/test/references/render/BeforeAfterFull/str3_new.txt new file mode 100644 index 0000000..6d4bc9f --- /dev/null +++ b/test/references/render/BeforeAfterFull/str3_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0] +------------------------------- diff --git a/test/references/render/BeforeAfterImage/img2d_1_compare.txt b/test/references/render/BeforeAfterImage/img2d_1_compare.txt new file mode 100644 index 0000000..8cb299c --- /dev/null +++ b/test/references/render/BeforeAfterImage/img2d_1_compare.txt @@ -0,0 +1,12 @@ +- REFERENCE ------------------- +eltype: Gray{N0f8} +size: (2, 5) +thumbnail: +▀▀▀▀▀ +------------------------------- +- ACTUAL ---------------------- +eltype: Gray{N0f8} +size: (2, 5) +thumbnail: +▀▀▀▀▀ +------------------------------- diff --git a/test/references/render/BeforeAfterImage/img2d_1_new.txt b/test/references/render/BeforeAfterImage/img2d_1_new.txt new file mode 100644 index 0000000..060ede4 --- /dev/null +++ b/test/references/render/BeforeAfterImage/img2d_1_new.txt @@ -0,0 +1,6 @@ +- NEW CONTENT ----------------- +eltype: Gray{N0f8} +size: (2, 5) +thumbnail: +▀▀▀▀▀ +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/arr1_compare.txt b/test/references/render/BeforeAfterLimited/arr1_compare.txt new file mode 100644 index 0000000..a37982b --- /dev/null +++ b/test/references/render/BeforeAfterLimited/arr1_compare.txt @@ -0,0 +1,9 @@ +- REFERENCE ------------------- +2×4 Matrix{Int64}: + 1 3 5 7 + 2 4 6 8 +------------------------------- +- ACTUAL ---------------------- +1×8 Matrix{Int64}: + 1 2 3 4 5 6 7 8 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/arr1_new.txt b/test/references/render/BeforeAfterLimited/arr1_new.txt new file mode 100644 index 0000000..b2b82c7 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/arr1_new.txt @@ -0,0 +1,4 @@ +- NEW CONTENT ----------------- +1×8 Matrix{Int64}: + 1 2 3 4 5 6 7 8 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/arr2_compare.txt b/test/references/render/BeforeAfterLimited/arr2_compare.txt new file mode 100644 index 0000000..94952de --- /dev/null +++ b/test/references/render/BeforeAfterLimited/arr2_compare.txt @@ -0,0 +1,23 @@ +- REFERENCE ------------------- +10-element Vector{Int64}: + 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 +------------------------------- +- ACTUAL ---------------------- +7-element Vector{Int64}: + 1 + 4 + 7 + 10 + 13 + 16 + 19 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/arr2_new.txt b/test/references/render/BeforeAfterLimited/arr2_new.txt new file mode 100644 index 0000000..a52e07f --- /dev/null +++ b/test/references/render/BeforeAfterLimited/arr2_new.txt @@ -0,0 +1,10 @@ +- NEW CONTENT ----------------- +7-element Vector{Int64}: + 1 + 4 + 7 + 10 + 13 + 16 + 19 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/arr3_compare.txt b/test/references/render/BeforeAfterLimited/arr3_compare.txt new file mode 100644 index 0000000..772f26d --- /dev/null +++ b/test/references/render/BeforeAfterLimited/arr3_compare.txt @@ -0,0 +1,38 @@ +- REFERENCE ------------------- +20×20 Matrix{Float64}: + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 … 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 … 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + ⋮ ⋮ ⋱ ⋮ + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 … 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 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 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/arr3_new.txt b/test/references/render/BeforeAfterLimited/arr3_new.txt new file mode 100644 index 0000000..97e341b --- /dev/null +++ b/test/references/render/BeforeAfterLimited/arr3_new.txt @@ -0,0 +1,19 @@ +- NEW CONTENT ----------------- +20×20 Matrix{Float64}: + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 … 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 … 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + ⋮ ⋮ ⋱ ⋮ + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 … 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 + 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/dataframe1_compare.txt b/test/references/render/BeforeAfterLimited/dataframe1_compare.txt new file mode 100644 index 0000000..9639669 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/dataframe1_compare.txt @@ -0,0 +1,18 @@ +- REFERENCE ------------------- +3×2 DataFrame +│ Row │ v1 │ v2 │ +│ │ Int64 │ String │ +├─────┼───────┼────────┤ +│ 1 │ 1 │ a │ +│ 2 │ 2 │ b │ +│ 3 │ 3 │ c │ +------------------------------- +- ACTUAL ---------------------- +3×2 DataFrame +│ Row │ v2 │ v1 │ +│ │ Int64 │ String │ +├─────┼───────┼────────┤ +│ 1 │ 1 │ a │ +│ 2 │ 2 │ b │ +│ 3 │ 3 │ c │ +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/dataframe1_new.txt b/test/references/render/BeforeAfterLimited/dataframe1_new.txt new file mode 100644 index 0000000..9f1b3d4 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/dataframe1_new.txt @@ -0,0 +1,9 @@ +- NEW CONTENT ----------------- +3×2 DataFrame +│ Row │ v2 │ v1 │ +│ │ Int64 │ String │ +├─────┼───────┼────────┤ +│ 1 │ 1 │ a │ +│ 2 │ 2 │ b │ +│ 3 │ 3 │ c │ +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/num1_compare.txt b/test/references/render/BeforeAfterLimited/num1_compare.txt new file mode 100644 index 0000000..387dce3 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/num1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +1 +------------------------------- +- ACTUAL ---------------------- +2 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/num1_new.txt b/test/references/render/BeforeAfterLimited/num1_new.txt new file mode 100644 index 0000000..44d5609 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/num1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +2 +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/str1_compare.txt b/test/references/render/BeforeAfterLimited/str1_compare.txt new file mode 100644 index 0000000..c2f9fd4 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/str1_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +"Hello world" +------------------------------- +- ACTUAL ---------------------- +"hello World" +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/str1_new.txt b/test/references/render/BeforeAfterLimited/str1_new.txt new file mode 100644 index 0000000..099e352 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/str1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +"hello World" +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/str2_compare.txt b/test/references/render/BeforeAfterLimited/str2_compare.txt new file mode 100644 index 0000000..fe47424 --- /dev/null +++ b/test/references/render/BeforeAfterLimited/str2_compare.txt @@ -0,0 +1,6 @@ +- REFERENCE ------------------- +"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]" +------------------------------- +- ACTUAL ---------------------- +"[1, 4, 7, 10, 13, 16, 19]" +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/str2_new.txt b/test/references/render/BeforeAfterLimited/str2_new.txt new file mode 100644 index 0000000..a275f8f --- /dev/null +++ b/test/references/render/BeforeAfterLimited/str2_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +"[1, 4, 7, 10, 13, 16, 19]" +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/str3_compare.txt b/test/references/render/BeforeAfterLimited/str3_compare.txt new file mode 100644 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.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0]" +------------------------------- diff --git a/test/references/render/BeforeAfterLimited/str3_new.txt b/test/references/render/BeforeAfterLimited/str3_new.txt new file mode 100644 index 0000000..1aca74b --- /dev/null +++ b/test/references/render/BeforeAfterLimited/str3_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +"[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.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------- diff --git a/test/references/render/Diff/str1_compare.txt b/test/references/render/Diff/str1_compare.txt new file mode 100644 index 0000000..7803ea5 --- /dev/null +++ b/test/references/render/Diff/str1_compare.txt @@ -0,0 +1,3 @@ +- DIFF ------------------------ +"{-H-}{+h+}ello {-w-}{+W+}orld" +------------------------------- diff --git a/test/references/render/Diff/str1_new.txt b/test/references/render/Diff/str1_new.txt new file mode 100644 index 0000000..d41abdf --- /dev/null +++ b/test/references/render/Diff/str1_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +hello World +------------------------------- diff --git a/test/references/render/Diff/str2_compare.txt b/test/references/render/Diff/str2_compare.txt new file mode 100644 index 0000000..f0e41b7 --- /dev/null +++ b/test/references/render/Diff/str2_compare.txt @@ -0,0 +1,3 @@ +- DIFF ------------------------ +"[1{-, 3-}, {-5-}{+4+}, 7{-, 9-}, {-1-}1{+0+}, 13{-, 15-}, 1{-7-}{+6+}, 19]" +------------------------------- diff --git a/test/references/render/Diff/str2_new.txt b/test/references/render/Diff/str2_new.txt new file mode 100644 index 0000000..c7a1149 --- /dev/null +++ b/test/references/render/Diff/str2_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1, 4, 7, 10, 13, 16, 19] +------------------------------- diff --git a/test/references/render/Diff/str3_compare.txt b/test/references/render/Diff/str3_compare.txt new file mode 100644 index 0000000..3e0bfa9 --- /dev/null +++ b/test/references/render/Diff/str3_compare.txt @@ -0,0 +1,3 @@ +- DIFF ------------------------ +"[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0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 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0]" +------------------------------- diff --git a/test/references/render/Diff/str3_new.txt b/test/references/render/Diff/str3_new.txt new file mode 100644 index 0000000..6d4bc9f --- /dev/null +++ b/test/references/render/Diff/str3_new.txt @@ -0,0 +1,3 @@ +- NEW CONTENT ----------------- +[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0; 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 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 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0] +------------------------------- diff --git a/test/references/string/string5.txt b/test/references/string/string5.txt index 1ad52bb..1001542 100644 --- a/test/references/string/string5.txt +++ b/test/references/string/string5.txt @@ -1,2 +1,2 @@ -This is a +This is a multiline string that does not end with a new line. \ No newline at end of file diff --git a/test/render.jl b/test/render.jl index e69de29..91e4276 100644 --- a/test/render.jl +++ b/test/render.jl @@ -0,0 +1,128 @@ +using ReferenceTests: Diff, BeforeAfterFull, BeforeAfterImage, BeforeAfterLimited +using ReferenceTests: render, render_item + +refdir = joinpath(refroot, "render") + +@testset "rendermode" begin + gray_1d = Gray{N0f8}.(0.0:0.1:0.9) + rgb_1d = RGB.(gray_1d) + gray_2d = Gray{N0f8}.(reshape(0.0:0.1:0.9, 2, 5)) + rgb_2d = RGB.(gray_2d) + + df = DataFrame(v1=[1,2,3], v2=["a","b","c"]) + + check_types = [ + # text types + ("string", Diff()), + (["string", "array"], Diff()), + + # number types + (1, BeforeAfterFull()), + (1.0im, BeforeAfterFull()), + ([1 2], BeforeAfterLimited()), + ([1,2], BeforeAfterLimited()), + + # image types + (gray_1d, BeforeAfterImage()), + (rgb_2d, BeforeAfterImage()), + + # dataframe types + (df, BeforeAfterLimited()), + ] + + for (x, mode) in check_types + # @info "Types" data=typeof(x) + @test ReferenceTests.default_rendermode(typeof(x)) == mode + end + +end + +# `render_item` is repeatly called by `render` so we can skip it +@testset "render" begin + num1 = [1, 2] + + arr1 = [reshape(collect(1:8), 2, 4), reshape(collect(1:8), 1, 8)] + arr2 = [collect(1:2:20), collect(1:3:20)] + arr3 = [ones(20, 20), ones(20, 20)] + + str1 = ["Hello world", "hello World"] + str2 = string.(arr2) + str3 = string.(arr3) + + img1d_1 = [Gray{N0f8}.(0.0:0.1:0.9), Gray{N0f8}.(0.9:-0.1:0.0)] # different content + img1d_2 = [Gray{N0f8}.(0.0:0.1:0.9), Gray{N0f8}.(0.0:0.05:0.95)] # different size + img1d_3 = [Gray{N0f8}.(0.0:0.1:0.9), RGB.(Gray{N0f8}.(0.0:0.1:0.9))] # different colorant + img2d_1 = [Gray{N0f8}.(reshape(0.0:0.1:0.9, 2, 5)), Gray{N0f8}.(reshape(0.9:-0.1:0.0, 2, 5))] + img3d_1 = [Gray{N0f8}.(reshape(0.0:0.02:0.95, 2, 4, 6)), Gray{N0f8}.(reshape(0.95:-0.02:0.00, 2, 4, 6))] + + df1 = [DataFrame(v1=[1,2,3], v2=["a","b","c"]), DataFrame(v2=[1,2,3], v1=["a","b","c"])] + items = [ + # numbers + (num1, "num1"), + (arr1, "arr1"), + (arr2, "arr2"), + (arr3, "arr3"), + # strings (hashes are also strings) + (str1, "str1"), + (str2, "str2"), + (str3, "str3"), + # images + (img1d_1, "img1d_1"), + (img1d_2, "img1d_2"), + (img1d_3, "img1d_3"), + (img2d_1, "img2d_1"), + (img3d_1, "img3d_1"), + # dataframe + (df1, "dataframe1"), + ] + + @testset "BeforeAfterFull" begin + mode = BeforeAfterFull() + for (x, xname) in items + # @info "Types" x=typeof(x) mode=mode + @test_reference joinpath(refdir, "BeforeAfterFull", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check + @test_reference joinpath(refdir, "BeforeAfterFull", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check + end + end + + @testset "BeforeAfterLimited" begin + mode = BeforeAfterLimited() + for (x, xname) in items + # @info "Types" x=typeof(x) mode=mode + + # FIXEME: ImageInTerminal issues + x[1] isa AbstractArray{<:Colorant} && continue + @test_reference joinpath(refdir, "BeforeAfterLimited", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check + @test_reference joinpath(refdir, "BeforeAfterLimited", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check + end + end + + @testset "Diff" begin + mode = Diff() + for (x, xname) in ( + (str1, "str1"), + (str2, "str2"), + (str3, "str3"), + ) + # @info "Types" x=typeof(x) mode=mode + @test_reference joinpath(refdir, "Diff", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check + @test_reference joinpath(refdir, "Diff", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check + end + end + + @testset "BeforeAfterImage" begin + mode = BeforeAfterImage() + for (x, xname) in ( + # (img1d_1, "img1d_1"), + # (img1d_2, "img1d_2"), + # (img1d_3, "img1d_3"), + (img2d_1, "img2d_1"), + # (img3d_1, "img3d_1") + ) + # @info "Types" x=typeof(x) mode=mode + @test_reference joinpath(refdir, "BeforeAfterImage", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check + @test_reference joinpath(refdir, "BeforeAfterImage", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check + end + end + +end diff --git a/test/testutils.jl b/test/testutils.jl index 8208b14..101ac47 100644 --- a/test/testutils.jl +++ b/test/testutils.jl @@ -1 +1,26 @@ strip_summary(content::String) = join(split(content, "\n")[2:end], "\n") + +function string_check(ref, actual) + # a over-verbose collection of patterns that we want to ignore during test + patterns = [ + # Julia v1.6 + "Normed{UInt8,8}" => "N0f8", + r"Array{(\w+),2}" => s"Matrix{\1}", + r"Array{(\w+),1}" => s"Vector{\1}", + + # https://github.com/JuliaGraphics/ColorTypes.jl/pull/206 + # r"Gray{\w+}\(([\w\.]+)\)" => s"\1", + # r"RGB{\w+}\(([\w\.,]+)\)" => s"RGB(\1)", + ] + + for p in patterns + actual = replace(actual, p) + ref = replace(ref, p) + end + + # Julia v1.4 + ref = join(map(strip, split(ref, "\n")), "\n") + actual = join(map(strip, split(actual, "\n")), "\n") + + isequal(ref, actual) +end