Skip to content

Commit 0ceea35

Browse files
authored
Fix tests for Julia 1.10 compatibility (#46)
1 parent 116ae6a commit 0ceea35

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

test/StickyMessages.jl

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,17 @@ end
4949
"\e[19;1H\e[J\e[1;20r\e[18;1H"
5050
end
5151

52-
@noinline func_barrier(f) = f()
53-
5452
@testset "Sticky messages with ANSI codes" begin
5553
buf = IOBuffer()
5654
dsize = (20, 80) # Intentionally different from default of 25 rows
57-
func_barrier() do
58-
# Hide stickies variable behind a function barrier to make sure(er)
59-
# that it can be GC'd.
60-
stickies = StickyMessages(IOContext(buf, :displaysize=>dsize), ansi_codes=true)
61-
push!(stickies, :a=>"a-msg\n")
62-
push!(stickies, :b=>"b-msg\n")
63-
take!(buf)
64-
nothing
65-
end
66-
# Hack to force StickyMessages finalizer
67-
GC.gc(true) # trigger finalizer
55+
stickies = StickyMessages(IOContext(buf, :displaysize=>dsize), ansi_codes=true)
56+
push!(stickies, :a=>"a-msg\n")
57+
push!(stickies, :b=>"b-msg\n")
58+
take!(buf)
59+
finalize(stickies)
60+
# Hack to allow StickyMessages async cleanup to run
6861
for i=1:1000
69-
yield() # allow async cleanup
62+
yield()
7063
end
7164
@test String(take!(buf)) == #clear #csr #pos
7265
"\e[19;1H\e[J\e[1;20r\e[18;1H"

test/TerminalLogger.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ end
304304
@test format_message("# Hi", 6, io_ctx) ==
305305
["",
306306
"Hi",
307-
"≡≡≡≡"]
307+
VERSION < v"1.10-DEV" ? "≡≡≡≡" : "≡≡"]
308308

309309
# For non-strings a blank line is added so that any formatting for
310310
# vertical alignment isn't broken

0 commit comments

Comments
 (0)