Weave.jl/test/chunk_options.jl

60 lines
2.2 KiB
Julia
Raw Normal View History

2016-04-20 20:01:14 +02:00
using Weave, Compat
2014-12-09 10:34:26 +01:00
using Base.Test
2016-04-11 19:34:36 +02:00
cleanup = true
2014-12-09 10:34:26 +01:00
#Test chunk options and output formats
weave("documents/chunk_options.noweb", plotlib=nothing)
2016-04-20 20:01:14 +02:00
result = @compat readstring(open("documents/chunk_options.md"))
ref = @compat readstring(open("documents/chunk_options_ref.md"))
2014-12-09 10:34:26 +01:00
@test result == ref
2016-04-11 19:34:36 +02:00
cleanup && rm("documents/chunk_options.md")
2014-12-09 10:34:26 +01:00
weave("documents/chunk_options.noweb", doctype="tex", plotlib=nothing)
2016-04-20 20:01:14 +02:00
result = @compat readstring(open("documents/chunk_options.tex"))
ref = @compat readstring(open("documents/chunk_options_ref.tex"))
2014-12-09 10:34:26 +01:00
@test result == ref
2016-04-11 19:34:36 +02:00
cleanup && rm("documents/chunk_options.tex")
2014-12-09 10:34:26 +01:00
weave("documents/chunk_options.noweb", doctype="texminted", plotlib=nothing)
2016-04-20 20:01:14 +02:00
result = @compat readstring(open("documents/chunk_options.tex"))
ref = @compat readstring(open("documents/chunk_options_ref.texminted"))
2014-12-09 10:34:26 +01:00
@test result == ref
2016-04-11 19:34:36 +02:00
cleanup && rm("documents/chunk_options.tex")
2014-12-09 10:34:26 +01:00
weave("documents/chunk_options.noweb", doctype="rst", plotlib=nothing)
2016-04-20 20:01:14 +02:00
result = @compat readstring(open("documents/chunk_options.rst"))
ref = @compat readstring(open("documents/chunk_options_ref.rst"))
2014-12-09 10:34:26 +01:00
@test result == ref
2016-04-11 19:34:36 +02:00
cleanup && rm("documents/chunk_options.rst")
2016-04-24 14:02:03 +02:00
#Test out_path
weave("documents/chunk_options.noweb", doctype="rst",
out_path="documents/outpath_options.rst" , plotlib=nothing)
result = @compat readstring(open("documents/outpath_options.rst"))
ref = @compat readstring(open("documents/chunk_options_ref.rst"))
@test result == ref
cleanup && rm("documents/outpath_options.rst")
#Test tangle
tangle("documents/chunk_options.noweb")
2016-04-20 20:01:14 +02:00
result = @compat readstring(open("documents/chunk_options.jl"))
ref = @compat readstring(open("documents/chunk_options_ref.jl"))
@test result == ref
2016-04-11 19:34:36 +02:00
cleanup && rm("documents/chunk_options.jl")
2016-04-24 14:02:03 +02:00
tangle("documents/chunk_options.noweb", out_path = "documents/outoptions.jl")
result = @compat readstring(open("documents/outoptions.jl"))
ref = @compat readstring(open("documents/chunk_options_ref.jl"))
@test result == ref
cleanup && rm("documents/outoptions.jl")
#Test functions and sandbox clearing
weave("documents/chunk_func.noweb", plotlib=nothing)
2016-04-20 20:01:14 +02:00
result = @compat readstring(open("documents/chunk_func.md"))
ref = @compat readstring(open("documents/chunk_func_ref.md"))
2016-04-11 19:34:36 +02:00
@test result == ref
cleanup && rm("documents/chunk_func.md")