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")
|
2014-12-21 08:25:45 +01:00
|
|
|
|
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
|
2014-12-21 08:25:45 +01:00
|
|
|
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"))
|
2015-01-05 15:35:24 +01:00
|
|
|
@test result == ref
|
2016-04-11 19:34:36 +02:00
|
|
|
cleanup && rm("documents/chunk_options.jl")
|
2015-01-09 15:48:58 +01:00
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
2016-04-19 16:07:07 +02:00
|
|
|
#Test functions and sandbox clearing
|
2015-01-09 15:48:58 +01:00
|
|
|
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")
|