aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test9.in
blob: 688dfb3f22b01eeb4fae2e7b451d61a22dee6e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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