Skip to content

Commit

Permalink
Merge pull request #36 from JuliaImages/jc/nightly_fix
Browse files Browse the repository at this point in the history
reference updates on summary changes in Julia nightly
  • Loading branch information
johnnychen94 authored Sep 11, 2020
2 parents 4c1a5b8 + a7844fd commit 93ed0c3
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ImageInTerminal"
uuid = "d8c32880-2388-543b-8c61-d9f865259254"
version = "0.4.4"
version = "0.4.5"

[deps]
Crayons = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
Expand Down
1 change: 0 additions & 1 deletion test/reference/2d_show_raw.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
4×4 Array{RGB{Float64},2} with eltype RGB{Float64}:
RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0)
RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0)
RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0) RGB{Float64}(1.0,1.0,1.0)
Expand Down
1 change: 0 additions & 1 deletion test/reference/lena_show_24bit.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
256×256 Array{RGB{N0f8},2} with eltype RGB{N0f8}:
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Expand Down
1 change: 0 additions & 1 deletion test/reference/lena_show_256.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
256×256 Array{RGB{N0f8},2} with eltype RGB{N0f8}:
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Expand Down
1 change: 0 additions & 1 deletion test/reference/rgbline_show_24bit.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
20-element mappedarray(RGB{Float64}, ImageCore.extractchannels, ::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::ImageCore.ZeroArray{Float64,1,Base.OneTo{Int64}}, ::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}) with eltype RGB{Float64}:
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ 
1 change: 0 additions & 1 deletion test/reference/rgbline_show_256.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
20-element mappedarray(RGB{Float64}, ImageCore.extractchannels, ::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::ImageCore.ZeroArray{Float64,1,Base.OneTo{Int64}}, ::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}) with eltype RGB{Float64}:
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ 
1 change: 0 additions & 1 deletion test/reference/rgbline_show_raw.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
20-element Array{RGB{Float64},1} with eltype RGB{Float64}:
RGB{Float64}(0.0,0.0,1.0)
RGB{Float64}(0.05263157894736842,0.0,0.9473684210526315)
RGB{Float64}(0.10526315789473684,0.0,0.8947368421052632)
Expand Down
19 changes: 9 additions & 10 deletions test/tst_baseshow.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
function _tostring(io)
function _tostring(io; strip_summary=false)
contents = map(readlines(seek(io,0))) do line
replace(strip(line), "$Int" => "Int64")
end

# ignore summary changes from upstream
contents[1] = replace(contents[1], "Normed{UInt8,8}"=>"N0f8")
contents
# ignore summary
strip_summary ? contents[2:end] : contents
end

@testset "enable/disable encoding" begin
Expand Down Expand Up @@ -40,10 +39,10 @@ end
io = IOBuffer()
img = fill(RGB(1.0, 1.0, 1.0), 4, 4)
show(io, MIME"text/plain"(), img)
@test_reference "reference/2d_show_raw.txt" _tostring(io)
@test_reference "reference/2d_show_raw.txt" _tostring(io; strip_summary=true)
io = IOBuffer()
show(io, MIME"text/plain"(), collect(rgb_line))
@test_reference "reference/rgbline_show_raw.txt" _tostring(io)
@test_reference "reference/rgbline_show_raw.txt" _tostring(io; strip_summary=true)
io = IOBuffer()
show(io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
@test_reference "reference/colorant_show_raw.txt" _tostring(io)
Expand All @@ -53,10 +52,10 @@ end
ImageInTerminal.use_256()
io = IOBuffer()
ensurecolor(show, io, MIME"text/plain"(), lena)
@test_reference "reference/lena_show_256.txt" _tostring(io)
@test_reference "reference/lena_show_256.txt" _tostring(io; strip_summary=true)
io = IOBuffer()
ensurecolor(show, io, MIME"text/plain"(), rgb_line)
@test_reference "reference/rgbline_show_256.txt" _tostring(io)
@test_reference "reference/rgbline_show_256.txt" _tostring(io; strip_summary=true)
io = IOBuffer()
ensurecolor(show, io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
@test_reference "reference/colorant_show_256.txt" _tostring(io)
Expand All @@ -66,10 +65,10 @@ end
ImageInTerminal.use_24bit()
io = IOBuffer()
ensurecolor(show, io, MIME"text/plain"(), lena)
@test_reference "reference/lena_show_24bit.txt" _tostring(io)
@test_reference "reference/lena_show_24bit.txt" _tostring(io; strip_summary=true)
io = IOBuffer()
ensurecolor(show, io, MIME"text/plain"(), rgb_line)
@test_reference "reference/rgbline_show_24bit.txt" _tostring(io)
@test_reference "reference/rgbline_show_24bit.txt" _tostring(io; strip_summary=true)
io = IOBuffer()
ensurecolor(show, io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
@test_reference "reference/colorant_show_24bit.txt" _tostring(io)
Expand Down

2 comments on commit 93ed0c3

@johnnychen94
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/21224

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.5 -m "<description of version>" 93ed0c35cd0180722cf7e2f07e99b4356dba7f09
git push origin v0.4.5

Please sign in to comment.