|
1 |
| -function _tostring(io) |
| 1 | +function _tostring(io; strip_summary=false) |
2 | 2 | contents = map(readlines(seek(io,0))) do line
|
3 | 3 | replace(strip(line), "$Int" => "Int64")
|
4 | 4 | end
|
5 | 5 |
|
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 |
9 | 8 | end
|
10 | 9 |
|
11 | 10 | @testset "enable/disable encoding" begin
|
|
40 | 39 | io = IOBuffer()
|
41 | 40 | img = fill(RGB(1.0, 1.0, 1.0), 4, 4)
|
42 | 41 | 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) |
44 | 43 | io = IOBuffer()
|
45 | 44 | 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) |
47 | 46 | io = IOBuffer()
|
48 | 47 | show(io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
|
49 | 48 | @test_reference "reference/colorant_show_raw.txt" _tostring(io)
|
|
53 | 52 | ImageInTerminal.use_256()
|
54 | 53 | io = IOBuffer()
|
55 | 54 | 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) |
57 | 56 | io = IOBuffer()
|
58 | 57 | 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) |
60 | 59 | io = IOBuffer()
|
61 | 60 | ensurecolor(show, io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
|
62 | 61 | @test_reference "reference/colorant_show_256.txt" _tostring(io)
|
|
66 | 65 | ImageInTerminal.use_24bit()
|
67 | 66 | io = IOBuffer()
|
68 | 67 | 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) |
70 | 69 | io = IOBuffer()
|
71 | 70 | 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) |
73 | 72 | io = IOBuffer()
|
74 | 73 | ensurecolor(show, io, MIME"text/plain"(), RGB(0.5,0.1,0.9))
|
75 | 74 | @test_reference "reference/colorant_show_24bit.txt" _tostring(io)
|
|
0 commit comments