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::urgent event works correctly. The window::urgent event
18 # should be emitted when a window becomes urgent or loses its urgent status.
23 my $win = open_window;
24 my $dummy_win = open_window;
27 my ($subscribecb, $win, $want) = @_;
29 my @events = events_for(
33 my @urgent = grep { $_->{change} eq 'urgent' } @events;
34 is(scalar @urgent, 1, 'Received 1 window::urgent event');
35 is($urgent[0]->{container}->{window}, $win->{id}, "window id matches");
36 is($urgent[0]->{container}->{urgent}, $want, "urgent is $want");
39 subtest "urgency set", \&urgency_subtest,
41 $win->add_hint('urgency');
47 subtest "urgency unset", \&urgency_subtest,
49 $win->delete_hint('urgency');