fixed #449, added test

This commit is contained in:
Jan Kanis
2012-12-19 15:56:19 +01:00
parent aa477195d4
commit 1f0ae8b06d
5 changed files with 70 additions and 36 deletions

0
tests/test9.err Normal file
View File

25
tests/test9.in Normal file
View File

@@ -0,0 +1,25 @@
# Test events.
# This pattern caused a crash; github issue #449
set -g var before
function test1 --on-event test
set -g var $var:test1
functions -e test2
end
function test2 --on-event test
# this should not run, as test2 gets removed before it has a chance of running
set -g var $var:test2a
end
emit test
echo $var
function test3 --on-event test3
echo received event test3 with args: $argv
end
emit test3 foo bar

2
tests/test9.out Normal file
View File

@@ -0,0 +1,2 @@
before:test1
received event test3 with args:

1
tests/test9.status Normal file
View File

@@ -0,0 +1 @@
0