2020-05-10 06:35:54 +02:00
|
|
|
# Test for Gadfly with different chunk options and figure formatsusing Weave
|
|
|
|
|
2020-05-10 07:37:50 +02:00
|
|
|
using Gadfly, Cairo
|
2020-05-10 06:35:54 +02:00
|
|
|
|
2014-12-08 22:51:27 +01:00
|
|
|
|
2019-03-11 09:23:31 +01:00
|
|
|
function test_gadfly(doctype, fig_ext)
|
|
|
|
out = weave(joinpath(@__DIR__ , "documents/gadfly_formats_test.jnw"),
|
|
|
|
out_path = joinpath(@__DIR__ , "documents/gadfly/"),
|
|
|
|
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
|
2014-12-09 21:17:20 +01:00
|
|
|
|
2019-03-11 09:23:31 +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")
|
2019-03-11 09:23:31 +01:00
|
|
|
test_gadfly("tex", ".pdf")
|
|
|
|
test_gadfly("tex", ".png")
|
2019-03-11 14:13:30 +01:00
|
|
|
test_gadfly("tex", ".ps")
|
|
|
|
test_gadfly("tex", ".tex")
|
2014-12-08 22:51:27 +01:00
|
|
|
|
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
|