Skip to content

Commit 0dc2d48

Browse files
committed
fix removing breakpoints
1 parent 8642d1c commit 0dc2d48

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/breakpoints.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ for (name, list) in ((:breakpoint, :breakon_rules), (:uninstrumented, :no_instru
4141
@eval function $(rm!)(the_rules::BreakpointRules, args...)
4242
old_num_rules = length(the_rules.$list)
4343
to_remove = rules(args...)
44-
filter!(x->xto_remove, the_rules.$list)
44+
filter!(!in(to_remove), the_rules.$list)
4545
if length(the_rules.$list) == old_num_rules
46-
@info("No matching $($name) was found, so none removed")
46+
@info("No matching rule was found, so none removed")
4747
end
4848
return the_rules.$list
4949
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ test_files = (
66
"test_behavour.jl",
77
"test_breadcrumbs.jl",
88
"test_breakpoint_rules.jl",
9+
"test_breakpoints.jl",
910
"test_inner_repl.jl",
1011
"test_locate.jl",
1112
"test_method_utils.jl",

test/test_breakpoints.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using MagneticReadHead
2+
using Test
3+
4+
@testset "Should be able to add and remove breakpoints" begin
5+
@test length(set_breakpoint!(Test)) == 1
6+
@test length(rm_breakpoint!(Test)) == 0
7+
8+
@test length(set_uninstrumented!(Test)) == 1
9+
@test length(rm_uninstrumented!(Test)) == 0
10+
end

0 commit comments

Comments
 (0)