Open t-bltg opened 2 years ago
:exclamation: No coverage uploaded for pull request base (
master@07011d3
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #18 +/- ##
=========================================
Coverage ? 41.19%
=========================================
Files ? 10
Lines ? 352
Branches ? 0
=========================================
Hits ? 145
Misses ? 207
Partials ? 0
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@johnnychen94 ?
Regarding the tests, there is something fundamentally fishy with
==> side effect of https://github.com/JuliaLang/Pkg.jl/pull/3065.src/terminaltools.jl
: query_terminal
requires stdin
fd to be opened, and under the tests, stdin
is closed since tests are ran under non interactive
mode, so testing is not representative.
I couldn't find a way to fake stdin
when querying sixel
support, so I'm a bit stuck here @johnnychen94.
Why would you need the interactive mode to run the test? I mean, it's more or less like how https://github.com/JuliaIO/Sixel.jl/blob/07011d31c9308a29d58390fb83aa14268d1a21e1/test/backend/libsixel.jl#L60-L63 does for RGBA
, right?
img = rand(RGBA, 5, 5)
io = IOBuffer()
sixel_encode(io, img)
@test ref == String(take!(io))
sixel_encode
supports three outputs:
sixel_encode(img)
: println to stdout
. This requires interactive mode (actually not, but CI environment doesn't support sixel)sixel_encode(::IO, img)
It's okay to use IOBuffer
to get the encoded sequence and test against it.
Last commit is optional, let me know I you don't want it.
Let's put this on hold since the real fix would (hopefully) be brought by https://github.com/libsixel/libsixel/pull/23.
I'm planning of bumping libsixel
to 1.10.3
(https://github.com/JuliaPackaging/Yggdrasil/pull/5432 - might require running gen/generator.jl
here).
@t-bltg Perhaps we should work together instead of separately, as I got a bit scared off by all the memory safety issues in libsixel so have been afraid to make big changes to the C code, especially because we know for a fact the current API's aren't even able to be made safe as a few of them lack critical information like data size.
I don't know Julia, sorry, but my longterm plan upstream has been to:
That's certainly a good idea to transition to rust
if you want something similar to current c interface. I must admit I never wrote rust
code (lots of Fortran
and C
, and obviously julia
) ;). But if I can help in any way ...
Fix https://github.com/JuliaIO/Sixel.jl/issues/17.
PR (mlterm)
master