Skip to content

Commit 7b0f356

Browse files
committed
fix nightly test failure
1 parent 2689c14 commit 7b0f356

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

test/render.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ end
8080
mode = BeforeAfterFull()
8181
for (x, xname) in items
8282
# @info "Types" x=typeof(x) mode=mode
83-
@test_reference joinpath(refdir, "BeforeAfterFull", "$(xname)_new.txt") @io2str render(::IO, mode, x[2])
84-
@test_reference joinpath(refdir, "BeforeAfterFull", "$(xname)_compare.txt") @io2str render(::IO, mode, x...)
83+
@test_reference joinpath(refdir, "BeforeAfterFull", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check
84+
@test_reference joinpath(refdir, "BeforeAfterFull", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check
8585
end
8686
end
8787

8888
@testset "BeforeAfterLimited" begin
8989
mode = BeforeAfterLimited()
9090
for (x, xname) in items
9191
# @info "Types" x=typeof(x) mode=mode
92-
@test_reference joinpath(refdir, "BeforeAfterLimited", "$(xname)_new.txt") @io2str render(::IO, mode, x[2])
93-
@test_reference joinpath(refdir, "BeforeAfterLimited", "$(xname)_compare.txt") @io2str render(::IO, mode, x...)
92+
@test_reference joinpath(refdir, "BeforeAfterLimited", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check
93+
@test_reference joinpath(refdir, "BeforeAfterLimited", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check
9494
end
9595
end
9696

@@ -102,8 +102,8 @@ end
102102
(str3, "str3"),
103103
)
104104
# @info "Types" x=typeof(x) mode=mode
105-
@test_reference joinpath(refdir, "Diff", "$(xname)_new.txt") @io2str render(::IO, mode, x[2])
106-
@test_reference joinpath(refdir, "Diff", "$(xname)_compare.txt") @io2str render(::IO, mode, x...)
105+
@test_reference joinpath(refdir, "Diff", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check
106+
@test_reference joinpath(refdir, "Diff", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check
107107
end
108108
end
109109

@@ -117,8 +117,8 @@ end
117117
# (img3d_1, "img3d_1")
118118
)
119119
# @info "Types" x=typeof(x) mode=mode
120-
@test_reference joinpath(refdir, "BeforeAfterImage", "$(xname)_new.txt") @io2str render(::IO, mode, x[2])
121-
@test_reference joinpath(refdir, "BeforeAfterImage", "$(xname)_compare.txt") @io2str render(::IO, mode, x...)
120+
@test_reference joinpath(refdir, "BeforeAfterImage", "$(xname)_new.txt") @io2str(render(::IO, mode, x[2])) by=string_check
121+
@test_reference joinpath(refdir, "BeforeAfterImage", "$(xname)_compare.txt") @io2str(render(::IO, mode, x...)) by=string_check
122122
end
123123
end
124124

test/testutils.jl

+17
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
11
strip_summary(content::String) = join(split(content, "\n")[2:end], "\n")
2+
3+
function string_check(ref, actual)
4+
patterns = [
5+
# Julia v1.6
6+
"Normed{UInt8,8}" => "N0f8",
7+
8+
# https://github.com/JuliaGraphics/ColorTypes.jl/pull/206
9+
# r"Gray{\w+}\(([\w\.]+)\)" => s"\1",
10+
# r"RGB{\w+}\(([\w\.,]+)\)" => s"RGB(\1)",
11+
]
12+
13+
for p in patterns
14+
actual = replace(actual, p)
15+
ref = replace(ref, p)
16+
end
17+
isequal(ref, actual)
18+
end

0 commit comments

Comments
 (0)