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)
|
2020-05-16 13:33:48 +02:00
|
|
|
out = weave(
|
|
|
|
joinpath(@__DIR__ , "documents/gadfly_formats_test.jnw"),
|
|
|
|
doctype = doctype,
|
|
|
|
fig_ext = fig_ext
|
|
|
|
)
|
2019-03-11 09:23:31 +01:00
|
|
|
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
|
2019-03-11 09:23:31 +01:00
|
|
|
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
|