2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Test that the window::floating event works correctly. This event should be
18 # emitted when a window transitions to or from the floating state.
19 # Bug still in: 4.8-7-gf4a8253
22 sub floating_subtest {
23 my ($win, $cmd, $want) = @_;
25 my @events = events_for(
29 my @floating = grep { $_->{change} eq 'floating' } @events;
30 is(scalar @floating, 1, 'Received 1 floating event');
31 is($floating[0]->{container}->{window}, $win->{id}, "window id matches");
32 is($floating[0]->{container}->{floating}, $want, "floating is $want");
35 my $win = open_window();
37 subtest 'floating enable', \&floating_subtest, $win, '[id="' . $win->{id} . '"] floating enable', 'user_on';
38 subtest 'floating disable', \&floating_subtest, $win, '[id="' . $win->{id} . '"] floating disable', 'user_off';