]> git.sur5r.net Git - i3/i3/blob - testcases/t/275-ipc-window-close.t
Merge branch 'release-4.16.1'
[i3/i3] / testcases / t / 275-ipc-window-close.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Tests that the ipc close event works properly
18 #
19 # Bug still in: 4.8-7-gf4a8253
20 use i3test;
21
22 my $window = open_window;
23
24 my @events = events_for(
25     sub {
26         $window->unmap;
27         sync_with_i3;
28     },
29     'window');
30
31 my @close = grep { $_->{change} eq 'close' } @events;
32 is(scalar @close, 1, 'Received 1 window::close event');
33 is($close[0]->{container}->{window}, $window->{id}, 'the event should contain information about the window');
34
35 done_testing;