Skip to content

Commit

Permalink
fix removing breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Jul 13, 2019
1 parent 8642d1c commit 0dc2d48
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/breakpoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ for (name, list) in ((:breakpoint, :breakon_rules), (:uninstrumented, :no_instru
@eval function $(rm!)(the_rules::BreakpointRules, args...)
old_num_rules = length(the_rules.$list)
to_remove = rules(args...)
filter!(x->xto_remove, the_rules.$list)
filter!(!in(to_remove), the_rules.$list)
if length(the_rules.$list) == old_num_rules
@info("No matching $($name) was found, so none removed")
@info("No matching rule was found, so none removed")
end
return the_rules.$list
end
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test_files = (
"test_behavour.jl",
"test_breadcrumbs.jl",
"test_breakpoint_rules.jl",
"test_breakpoints.jl",
"test_inner_repl.jl",
"test_locate.jl",
"test_method_utils.jl",
Expand Down
10 changes: 10 additions & 0 deletions test/test_breakpoints.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using MagneticReadHead
using Test

@testset "Should be able to add and remove breakpoints" begin
@test length(set_breakpoint!(Test)) == 1
@test length(rm_breakpoint!(Test)) == 0

@test length(set_uninstrumented!(Test)) == 1
@test length(rm_uninstrumented!(Test)) == 0
end

0 comments on commit 0dc2d48

Please sign in to comment.