Skip to content

Commit 93ed0c3

Browse files
authored
Merge pull request #36 from JuliaImages/jc/nightly_fix
reference updates on summary changes in Julia nightly
2 parents 4c1a5b8 + a7844fd commit 93ed0c3

8 files changed

+10
-17
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ImageInTerminal"
22
uuid = "d8c32880-2388-543b-8c61-d9f865259254"
3-
version = "0.4.4"
3+
version = "0.4.5"
44

55
[deps]
66
Crayons = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"

test/reference/2d_show_raw.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
4×4 Array{RGB{Float64},2} with eltype RGB{Float64}:
21
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)
32
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)
43
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)

test/reference/lena_show_24bit.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
256×256 Array{RGB{N0f8},2} with eltype RGB{N0f8}:
21
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
32
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
43
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

test/reference/lena_show_256.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
256×256 Array{RGB{N0f8},2} with eltype RGB{N0f8}:
21
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
32
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
43
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

test/reference/rgbline_show_24bit.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
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}:
21
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ 

test/reference/rgbline_show_256.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
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}:
21
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ 

test/reference/rgbline_show_raw.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
20-element Array{RGB{Float64},1} with eltype RGB{Float64}:
21
RGB{Float64}(0.0,0.0,1.0)
32
RGB{Float64}(0.05263157894736842,0.0,0.9473684210526315)
43
RGB{Float64}(0.10526315789473684,0.0,0.8947368421052632)

test/tst_baseshow.jl

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
function _tostring(io)
1+
function _tostring(io; strip_summary=false)
22
contents = map(readlines(seek(io,0))) do line
33
replace(strip(line), "$Int" => "Int64")
44
end
55

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

1110
@testset "enable/disable encoding" begin
@@ -40,10 +39,10 @@ end
4039
io = IOBuffer()
4140
img = fill(RGB(1.0, 1.0, 1.0), 4, 4)
4241
show(io, MIME"text/plain"(), img)
43-
@test_reference "reference/2d_show_raw.txt" _tostring(io)
42+
@test_reference "reference/2d_show_raw.txt" _tostring(io; strip_summary=true)
4443
io = IOBuffer()
4544
show(io, MIME"text/plain"(), collect(rgb_line))
46-
@test_reference "reference/rgbline_show_raw.txt" _tostring(io)
45+
@test_reference "reference/rgbline_show_raw.txt" _tostring(io; strip_summary=true)
4746
io = IOBuffer()
4847
show(io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
4948
@test_reference "reference/colorant_show_raw.txt" _tostring(io)
@@ -53,10 +52,10 @@ end
5352
ImageInTerminal.use_256()
5453
io = IOBuffer()
5554
ensurecolor(show, io, MIME"text/plain"(), lena)
56-
@test_reference "reference/lena_show_256.txt" _tostring(io)
55+
@test_reference "reference/lena_show_256.txt" _tostring(io; strip_summary=true)
5756
io = IOBuffer()
5857
ensurecolor(show, io, MIME"text/plain"(), rgb_line)
59-
@test_reference "reference/rgbline_show_256.txt" _tostring(io)
58+
@test_reference "reference/rgbline_show_256.txt" _tostring(io; strip_summary=true)
6059
io = IOBuffer()
6160
ensurecolor(show, io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
6261
@test_reference "reference/colorant_show_256.txt" _tostring(io)
@@ -66,10 +65,10 @@ end
6665
ImageInTerminal.use_24bit()
6766
io = IOBuffer()
6867
ensurecolor(show, io, MIME"text/plain"(), lena)
69-
@test_reference "reference/lena_show_24bit.txt" _tostring(io)
68+
@test_reference "reference/lena_show_24bit.txt" _tostring(io; strip_summary=true)
7069
io = IOBuffer()
7170
ensurecolor(show, io, MIME"text/plain"(), rgb_line)
72-
@test_reference "reference/rgbline_show_24bit.txt" _tostring(io)
71+
@test_reference "reference/rgbline_show_24bit.txt" _tostring(io; strip_summary=true)
7372
io = IOBuffer()
7473
ensurecolor(show, io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
7574
@test_reference "reference/colorant_show_24bit.txt" _tostring(io)

0 commit comments

Comments
 (0)