]> git.sur5r.net Git - i3/i3/blob - testcases/t/261-match-con_id-con_mark-combinations.t
Match on all criteria even if con_id or con_mark are given.
[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 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://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 is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');
31
32 cmd '[con_id=__focused__ class=matchme] kill';
33 is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');
34
35 ###############################################################################
36 # Verify that con_mark can be combined with other criteria
37 ###############################################################################
38
39 $ws = fresh_workspace;
40 open_window(wm_class => 'matchme');
41 cmd 'mark marked';
42
43 cmd '[con_mark=marked class=doesnotmatch] kill';
44 is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');
45
46 cmd '[con_mark=marked class=matchme] kill';
47 is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');
48
49 ###############################################################################
50
51 done_testing;