Skip to content

Commit

Permalink
Fixed return value of unhandled hook
Browse files Browse the repository at this point in the history
  • Loading branch information
tisztamo committed Jun 23, 2020
1 parent 211fb7c commit c06829e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ HookListTerminal = HookList{Nothing, Nothing, Nothing, Nothing}
return true
end

(hook::HookListTerminal)(::Vararg{Any}) = true
(hook::HookListTerminal)(::Vararg{Any}) = false

length(l::HookListTerminal) = 0
length(l::HookList) = 1 + length(l.next)
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ deferred_init(plugin::LifeCycleTestPlugin, data) = plugin.deferredinitcalledwith
@test innerplugin.hook2count == 0
end

@testset "Unhandled hook returns false" begin
app = Framework([EmptyPlugin()])
@test hooks(app, hook1_handler)() == false
end

@testset "Framework goes through" begin
frameworktestapp = Framework([EmptyPlugin(), FrameworkTestPlugin()])
hooks(frameworktestapp, hook1_handler)()
Expand Down

0 comments on commit c06829e

Please sign in to comment.