-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #377 from JunoLab/avi/simpletest
add simple end2end test
- Loading branch information
Showing
8 changed files
with
102 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# NOTE: | ||
# This test file does end to end tests, while we don't want to check the details in the generated documents. | ||
# Rather, we just assert we can `weave` all the supported formats without errors here. | ||
|
||
# TODO: | ||
# - more complex example | ||
# - integration with other libraries, like Plots | ||
|
||
@testset "end2end simple" begin | ||
include("test_simple.jl") | ||
end # @testset "end2end" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Weave.Dates | ||
|
||
|
||
test_doctypes = filter(first.(Weave.list_out_formats())) do doctype | ||
# don't test doctypes which need external programs | ||
doctype ∉ ("pandoc2html", "pandoc2pdf", "md2pdf") | ||
end | ||
|
||
function test_func(body) | ||
@test !isempty(body) | ||
date_str = string(Date(now())) | ||
@test occursin(date_str, body) | ||
end | ||
|
||
# julia markdown | ||
julia_markdown_body = """ | ||
# doc chunk | ||
this is text with `j :inline` code | ||
code chunk: | ||
```julia | ||
using Dates | ||
Date(now()) | ||
``` | ||
""" | ||
|
||
for doctype in test_doctypes | ||
test_mock_weave(test_func, julia_markdown_body; informat = "markdown", doctype = doctype) | ||
end | ||
|
||
# TODO: test noweb format | ||
|
||
# julia script | ||
julia_script_body = """ | ||
#' # doc chunk | ||
#' | ||
#' this is text with `j :inline` code | ||
#' | ||
#' code chunk: | ||
#+ | ||
using Dates | ||
Date(now()) | ||
""" | ||
for doctype in test_doctypes | ||
test_mock_weave(test_func, julia_script_body; informat = "script", doctype = doctype) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters