]> git.sur5r.net Git - i3/i3/blob - testcases/t/261-match-con_id-con_mark-combinations.t
Merge branch 'release-4.16.1'
[i3/i3] / testcases / t / 261-match-con_id-con_mark-combinations.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 # Ticket: #2111
18 use i3test;
19
20 my ($ws);
21
22 ###############################################################################
23 # Verify that con_id can be combined with other criteria
24 ###############################################################################
25
26 $ws = fresh_workspace;
27 open_window(wm_class => 'matchme');
28
29 cmd '[con_id=__focused__ class=doesnotmatch] kill';
30 sync_with_i3;
31 is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');
32
33 cmd '[con_id=__focused__ class=matchme] kill';
34 sync_with_i3;
35 is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');
36
37 ###############################################################################
38 # Verify that con_mark can be combined with other criteria
39 ###############################################################################
40
41 $ws = fresh_workspace;
42 open_window(wm_class => 'matchme');
43 cmd 'mark marked';
44
45 cmd '[con_mark=marked class=doesnotmatch] kill';
46 sync_with_i3;
47 is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');
48
49 cmd '[con_mark=marked class=matchme] kill';
50 sync_with_i3;
51 is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');
52
53 ###############################################################################
54
55 done_testing;