2011-08-09 02:19:48 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# checks if the IPC message type get_marks works correctly
|
|
|
|
#
|
|
|
|
use i3test;
|
|
|
|
|
|
|
|
sub get_marks {
|
2011-09-26 14:36:27 -04:00
|
|
|
return i3(get_socket_path())->get_marks->recv;
|
2011-08-09 02:19:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 1: check that get_marks returns no marks yet
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
my $tmp = fresh_workspace;
|
|
|
|
|
|
|
|
my $marks = get_marks();
|
2011-11-21 20:21:47 -05:00
|
|
|
is_deeply($marks, [], 'no marks set so far');
|
2011-08-09 02:19:48 -04:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 2: check that setting a mark is reflected in the get_marks reply
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
cmd 'open';
|
|
|
|
cmd 'mark foo';
|
|
|
|
|
2011-11-21 20:21:47 -05:00
|
|
|
is_deeply(get_marks(), [ 'foo' ], 'mark foo set');
|
2011-08-09 02:19:48 -04:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 3: check that the mark is gone after killing the container
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
cmd 'kill';
|
|
|
|
|
2011-11-21 20:21:47 -05:00
|
|
|
is_deeply(get_marks(), [ ], 'mark gone');
|
2011-08-09 02:19:48 -04:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# 4: check that duplicate marks are included twice in the get_marks reply
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
cmd 'open';
|
|
|
|
cmd 'mark bar';
|
|
|
|
|
|
|
|
cmd 'open';
|
|
|
|
cmd 'mark bar';
|
|
|
|
|
2011-11-21 20:21:47 -05:00
|
|
|
is_deeply(get_marks(), [ 'bar', 'bar' ], 'duplicate mark found twice');
|
2011-08-09 02:19:48 -04:00
|
|
|
|
|
|
|
done_testing;
|