Skip to content

Commit

Permalink
fix XTermColors world age: invokelatest (#121)
Browse files Browse the repository at this point in the history
* fix XTermColors world age: invokelatest

* ReferenceTests v0.10.1
  • Loading branch information
johnnychen94 authored Aug 19, 2022
1 parent 2a1955f commit 550b61c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ReferenceTests"
uuid = "324d217c-45ce-50fc-942e-d289b448e8cf"
authors = ["Christof Stocker <[email protected]>", "Frames White <[email protected]>", "Johnny Chen <[email protected]>"]
version = "0.10.0"
version = "0.10.1"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down
2 changes: 1 addition & 1 deletion src/fileio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function _convert(
# encode image into string
strs = @withcolor XTermColors.ascii_show(
img,
XTermColors.TermColor8bit(),
Base.invokelatest(XTermColors.TermColor8bit),
:small,
size
)
Expand Down
2 changes: 1 addition & 1 deletion src/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end
function render_item(::BeforeAfterImage, item)
str_item = @withcolor XTermColors.ascii_show(
item,
XTermColors.TermColor8bit(),
Base.invokelatest(XTermColors.TermColor8bit),
:small,
(20, 40)
)
Expand Down
11 changes: 11 additions & 0 deletions test/test_no_world_age_issues.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
using ReferenceTests: render_item, BeforeAfterImage

@testset "world age issues" begin
function test_render(file)
# https://github.com/JuliaTesting/ReferenceTests.jl/issues/120
render_item(BeforeAfterImage(), load(file))
end
function test_convert(file)
ReferenceTests._convert(DataFormat{:TXT}, load(file))
end
files = ["references/camera.png"]

for filename in files
ref_file = joinpath(@__DIR__, filename)
if isfile(ref_file)
@test_reference filename load(ref_file)
@test_nowarn test_render(ref_file)
@test_nowarn test_convert(ref_file)
else
@info "Skip reference file: $ref_file"
end
Expand Down

2 comments on commit 550b61c

@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/66545

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.10.1 -m "<description of version>" 550b61c6aaac67c767615783c6475b9050595d3d
git push origin v0.10.1

Please sign in to comment.