Closed IanButterworth closed 3 years ago
I also find this feature wanted when I try to develop Sixel.
@test_reference "test.six" sixel_string
Given that FileIO queries the data format of test.six
automatically and loads it as an image, @test_reference
will eventually try to compare a colorant array with a string value and thus throw an error.
For this reason, I agree that letting users to explicitly choose a loading format can be quite useful.
Ideally, we would want to make query_extended
smarter by dispatching also on the type of raw_actual
, i.e., something like this:
query_extended(filename, ::AbstractString) = FileIO.format"TXT"
function query_extended(filename, ::Any)
# the current query_extended implementation
end
But it's not a very trivial task with the current design because there's also a _convert
function that converts to the queried format.
I'm fixing the CI failure in #92 so you might need to rebase on master when that's done.
@johnnychen94, I've applied your suggestions, and I think that this PR is ready.
Can you review it, and if everything is OK merge this so that we can move forward on https://github.com/Evizero/UnicodePlots.jl/pull/136 ?
In
UnicodePlots
's reference tests, some of the txt files were being erroneously detected asGadget2
filetypes, where they just needed to be parsed as raw txt/string files.This adds a kwarg to force that.
Used in the WIP https://github.com/Evizero/UnicodePlots.jl/pull/136