2020-05-10 06:35:54 +02:00
|
|
|
using Plots
|
|
|
|
|
2016-04-27 21:02:20 +02:00
|
|
|
|
|
|
|
function pljtest(source, resfile, doctype)
|
2016-11-01 14:23:14 +01:00
|
|
|
weave("documents/$source", out_path = "documents/plotsjl/$resfile", doctype=doctype)
|
2018-07-23 12:37:25 +02:00
|
|
|
result = read("documents/plotsjl/$resfile", String)
|
|
|
|
ref = read("documents/plotsjl/$resfile.ref", String)
|
2016-04-27 21:02:20 +02:00
|
|
|
@test result == ref
|
2018-07-26 19:32:10 +02:00
|
|
|
rm("documents/plotsjl/$resfile")
|
2016-04-27 21:02:20 +02:00
|
|
|
end
|
|
|
|
|
2016-12-13 20:23:57 +01:00
|
|
|
pljtest("plotsjl_test_gr.jmd", "plotsjl_test_gr.md", "pandoc")
|
2018-07-26 10:35:17 +02:00
|
|
|
pljtest("plotsjl_test_gr.jmd", "plotsjl_test_gr.tex", "tex")
|
2019-01-03 14:40:32 +01:00
|
|
|
|
|
|
|
# test cache with plots
|
|
|
|
isdir("documents/cache") && rm("documents/cache", recursive = true)
|
|
|
|
weave("documents/plotsjl_test_gr.jmd", cache=:all)
|
|
|
|
result = read("documents/plotsjl_test_gr.html", String)
|
|
|
|
rm("documents/plotsjl_test_gr.html")
|
|
|
|
weave("documents/plotsjl_test_gr.jmd", cache=:all)
|
|
|
|
cached_result = read("documents/plotsjl_test_gr.html", String)
|
|
|
|
@test result == cached_result
|