Weave.jl/test/gadfly_formats.jl

32 lines
877 B
Julia
Raw Normal View History

# Test for Gadfly with different chunk options and figure formatsusing Weave
2020-05-10 07:37:50 +02:00
using Gadfly, Cairo
function test_gadfly(doctype, fig_ext)
2020-05-16 13:33:48 +02:00
out = weave(
joinpath(@__DIR__ , "documents/gadfly_formats_test.jnw"),
doctype = doctype,
fig_ext = fig_ext
)
result = read(out, String)
2020-05-16 09:05:02 +02:00
# cp(out, out*fig_ext*"."*doctype, force=true) # Used when adding new tests
ref = read(out*fig_ext*"."*doctype, String)
@test result == ref
rm(out)
end
2014-12-09 21:17:20 +01:00
test_gadfly("github", ".png")
test_gadfly("github", ".pdf")
test_gadfly("github", ".svg")
test_gadfly("pandoc", ".png")
2019-03-11 14:13:30 +01:00
test_gadfly("pandoc", ".js.svg")
test_gadfly("tex", ".pdf")
test_gadfly("tex", ".png")
2019-03-11 14:13:30 +01:00
test_gadfly("tex", ".ps")
test_gadfly("tex", ".tex")
2019-03-11 14:13:30 +01:00
p = Gadfly.plot(x=1:10, y=1:10)
@test showable(MIME"application/pdf"(), p) == true
@test showable(MIME"application/png"(), p) == true