aboutsummaryrefslogtreecommitdiff
path: root/testcases/t/261-match-con_id-con_mark-combinations.t
blob: a34dbfa5aee2167b075fa2558524ef3add053fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!perl
# vim:ts=4:sw=4:expandtab
#
# Please read the following documents before working on tests:
# • https://build.i3wm.org/docs/testsuite.html
#   (or docs/testsuite)
#
# • https://build.i3wm.org/docs/lib-i3test.html
#   (alternatively: perldoc ./testcases/lib/i3test.pm)
#
# • https://build.i3wm.org/docs/ipc.html
#   (or docs/ipc)
#
# • https://i3wm.org/downloads/modern_perl_a4.pdf
#   (unless you are already familiar with Perl)
#
# Ticket: #2111
use i3test;

my ($ws);

###############################################################################
# Verify that con_id can be combined with other criteria
###############################################################################

$ws = fresh_workspace;
open_window(wm_class => 'matchme');

cmd '[con_id=__focused__ class=doesnotmatch] kill';
sync_with_i3;
is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');

cmd '[con_id=__focused__ class=matchme] kill';
sync_with_i3;
is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');

###############################################################################
# Verify that con_mark can be combined with other criteria
###############################################################################

$ws = fresh_workspace;
open_window(wm_class => 'matchme');
cmd 'mark marked';

cmd '[con_mark=marked class=doesnotmatch] kill';
sync_with_i3;
is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');

cmd '[con_mark=marked class=matchme] kill';
sync_with_i3;
is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');

###############################################################################

done_testing;