mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 04:51:16 -03:00
fixed #449, added test
This commit is contained in:
0
tests/test9.err
Normal file
0
tests/test9.err
Normal file
25
tests/test9.in
Normal file
25
tests/test9.in
Normal 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
2
tests/test9.out
Normal file
@@ -0,0 +1,2 @@
|
||||
before:test1
|
||||
received event test3 with args:
|
||||
1
tests/test9.status
Normal file
1
tests/test9.status
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
Reference in New Issue
Block a user