]> git.sur5r.net Git - i3/i3/blob - testcases/t/220-ipc-window-title.t
Merge pull request #3376 from orestisf1993/floating-disable-scratchpad
[i3/i3] / testcases / t / 220-ipc-window-title.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 use i3test;
18
19 my $window = open_window(name => 'Window 0');
20
21 my @events = events_for(
22     sub {
23         $window->name('New Window Title');
24         sync_with_i3;
25     },
26     'window');
27
28 is(scalar @events, 1, 'Received 1 event');
29 is($events[0]->{change}, 'title', 'Window title change event received');
30 is($events[0]->{container}->{name}, 'New Window Title', 'Window title changed');
31
32 done_testing;