2015-12-15 07:38:56 -05:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# Please read the following documents before working on tests:
|
|
|
|
# • http://build.i3wm.org/docs/testsuite.html
|
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/lib-i3test.html
|
|
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/ipc.html
|
|
|
|
# (or docs/ipc)
|
|
|
|
#
|
|
|
|
# • http://onyxneon.com/books/modern_perl/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';
|
2015-12-27 22:11:51 -05:00
|
|
|
sync_with_i3;
|
2015-12-15 07:38:56 -05:00
|
|
|
is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');
|
|
|
|
|
|
|
|
cmd '[con_id=__focused__ class=matchme] kill';
|
2015-12-27 22:11:51 -05:00
|
|
|
sync_with_i3;
|
2015-12-15 07:38:56 -05:00
|
|
|
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';
|
2015-12-27 22:11:51 -05:00
|
|
|
sync_with_i3;
|
2015-12-15 07:38:56 -05:00
|
|
|
is(@{get_ws($ws)->{nodes}}, 1, 'window was not killed');
|
|
|
|
|
|
|
|
cmd '[con_mark=marked class=matchme] kill';
|
2015-12-27 22:11:51 -05:00
|
|
|
sync_with_i3;
|
2015-12-15 07:38:56 -05:00
|
|
|
is(@{get_ws($ws)->{nodes}}, 0, 'window was killed');
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
done_testing;
|