From 9e5ad966ebce454411fde2b7e2c0e55da504c730 Mon Sep 17 00:00:00 2001 From: Matti Pastell Date: Wed, 3 Jan 2018 09:37:05 +0200 Subject: [PATCH] Add script reader test --- test/convert_test.jl | 7 +++- test/documents/chunk_options.jl | 66 +++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 test/documents/chunk_options.jl diff --git a/test/convert_test.jl b/test/convert_test.jl index 0a86600..319349b 100644 --- a/test/convert_test.jl +++ b/test/convert_test.jl @@ -33,7 +33,10 @@ infile = "documents/chunk_options.noweb" convert_doc(infile, outfile) input = contents(Weave.read_doc(infile)) output = contents(Weave.read_doc(outfile)) +@test input == output rm(outfile) -@test input == output - +# Test script reader +@test contents( + Weave.read_doc("documents/chunk_options.noweb")) == contents( + Weave.read_doc("documents/chunk_options.jl")) \ No newline at end of file diff --git a/test/documents/chunk_options.jl b/test/documents/chunk_options.jl new file mode 100644 index 0000000..9492c2a --- /dev/null +++ b/test/documents/chunk_options.jl @@ -0,0 +1,66 @@ + +#+ term=true + +y= [2, 5, 12] + + +#+ term=true + +x = 1:10 +d = Dict("Weave" => "testing") +y = [2, 4 ,8] + + +#+ + +x = [12, 10] +println(y) +println(x) + + +#+ echo=false + +println("Results without code") +println(x) + + +#+ eval=false; tangle=false + +y = randn(5) +println("Don't eval, but show code") + + +#+ + +y = 1:5 +println(y) + + +#+ results="hidden" + +a = "Don't print me" +println(a) + + +#+ results="as_is" + +println("No markup for results.") + +#' +#' +#' Test wrapping: +#' +#+ + +println(collect(0:10:1000)) + + +#+ wrap=false + +println(collect(0:10:1000)) + + +#+ line_width=60 + +println(collect(0:10:1000)) +