mirror of https://github.com/mpastell/Weave.jl
Merge pull request #202 from tshort/hook-fix
Fix hooks and add a push/pop hook to the testpull/224/head
commit
9f664ba5a6
|
@ -226,11 +226,11 @@ include_weave(source, informat=:auto) = include_weave(Main, source, informat)
|
|||
#but note that Weave hooks take the chunk as input
|
||||
const preexecute_hooks = Function[]
|
||||
push_preexecute_hook(f::Function) = push!(preexecute_hooks, f)
|
||||
pop_preexecute_hook(f::Function) = splice!(preexecute_hooks, findfirst(preexecute_hooks, f))
|
||||
pop_preexecute_hook(f::Function) = splice!(preexecute_hooks, findfirst(x -> x == f, preexecute_hooks))
|
||||
|
||||
const postexecute_hooks = Function[]
|
||||
push_postexecute_hook(f::Function) = push!(postexecute_hooks, f)
|
||||
pop_postexecute_hook(f::Function) = splice!(postexecute_hooks, findfirst(postexecute_hooks, f))
|
||||
pop_postexecute_hook(f::Function) = splice!(postexecute_hooks, findfirst(x -> x == f, postexecute_hooks))
|
||||
|
||||
include("chunks.jl")
|
||||
include("config.jl")
|
||||
|
|
|
@ -5,7 +5,9 @@ cleanup = true
|
|||
|
||||
VER = "$(VERSION.major).$(VERSION.minor)"
|
||||
|
||||
Weave.push_preexecute_hook(identity)
|
||||
weave("documents/chunk_options.noweb")
|
||||
Weave.pop_preexecute_hook(identity)
|
||||
result = read("documents/chunk_options.md", String)
|
||||
ref = read("documents/chunk_options_ref.md", String)
|
||||
@test result == ref
|
||||
|
|
Loading…
Reference in New Issue