Weave.jl/test/gadfly_formats.jl

32 lines
877 B
Julia

# Test for Gadfly with different chunk options and figure formatsusing Weave
using Gadfly, Cairo
function test_gadfly(doctype, fig_ext)
out = weave(
joinpath(@__DIR__ , "documents/gadfly_formats_test.jnw"),
doctype = doctype,
fig_ext = fig_ext
)
result = read(out, String)
# 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
test_gadfly("github", ".png")
test_gadfly("github", ".pdf")
test_gadfly("github", ".svg")
test_gadfly("pandoc", ".png")
test_gadfly("pandoc", ".js.svg")
test_gadfly("tex", ".pdf")
test_gadfly("tex", ".png")
test_gadfly("tex", ".ps")
test_gadfly("tex", ".tex")
p = Gadfly.plot(x=1:10, y=1:10)
@test showable(MIME"application/pdf"(), p) == true
@test showable(MIME"application/png"(), p) == true