Skip to content

Commit

Permalink
Merge pull request #120 from TsurHerman/patch-1
Browse files Browse the repository at this point in the history
fix a bug in unbind! operator
  • Loading branch information
shashi committed Jan 30, 2017
2 parents d86ef4f + 8e1107f commit 1b4e2c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/operators.jl
Expand Up @@ -297,7 +297,7 @@ function unbind!(a::Signal, b::Signal, twoway=true)
end

action = _bindings[a=>b]
a.actions = filter(x->x!=action, a.actions)
b.actions = filter(x->x!=action, b.actions)
delete!(_bindings, a=>b)

if twoway
Expand Down
18 changes: 18 additions & 0 deletions test/basics.jl
Expand Up @@ -229,4 +229,22 @@ facts("Basic checks") do
step()
@fact value(y) --> 1
end


context("bindind") do
x = Signal(0)
y = Signal(0)
bind!(y,x,false)

push!(x,1000)
step()

@fact value(y) --> 1000

unbind!(y,x,false)
push!(x,0)
step()

@fact value(y) --> 1000
end
end

0 comments on commit 1b4e2c0

Please sign in to comment.