2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # checks if mark and unmark work correctly
21 return i3(get_socket_path())->get_marks->recv;
24 ##############################################################
25 # 1: check that there are no marks set yet
26 ##############################################################
28 my $tmp = fresh_workspace;
32 is_deeply(get_marks(), [], 'no marks set yet');
35 ##############################################################
36 # 2: mark a con, check that it's marked, unmark it, check that
37 ##############################################################
39 my $one = open_window;
42 is_deeply(get_marks(), ["foo"], 'mark foo set');
46 is_deeply(get_marks(), [], 'mark foo removed');
48 ##############################################################
49 # 3: mark three cons, check that they are marked
50 # unmark one con, check that it's unmarked
51 # unmark all cons, check that they are unmarked
52 ##############################################################
54 my $left = open_window;
55 my $middle = open_window;
56 my $right = open_window;
65 # get_marks replys an array of marks, whose order is undefined,
66 # so we use sort to be able to compare the output
69 is_deeply(sort(get_marks()), ["left","middle","right"], 'all three marks set');
73 is_deeply(sort(get_marks()), ["left","middle"], 'mark right removed');
77 is_deeply(get_marks(), [], 'all marks removed');