]> git.sur5r.net Git - i3/i3/blob - testcases/t/173-get-marks.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 173-get-marks.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # checks if the IPC message type get_marks works correctly
5 #
6 use i3test;
7
8 sub get_marks {
9     return i3(get_socket_path())->get_marks->recv;
10 }
11
12 ##############################################################
13 # 1: check that get_marks returns no marks yet
14 ##############################################################
15
16 my $tmp = fresh_workspace;
17
18 my $marks = get_marks();
19 is_deeply($marks, [], 'no marks set so far');
20
21 ##############################################################
22 # 2: check that setting a mark is reflected in the get_marks reply
23 ##############################################################
24
25 cmd 'open';
26 cmd 'mark foo';
27
28 is_deeply(get_marks(), [ 'foo' ], 'mark foo set');
29
30 ##############################################################
31 # 3: check that the mark is gone after killing the container
32 ##############################################################
33
34 cmd 'kill';
35
36 is_deeply(get_marks(), [ ], 'mark gone');
37
38 ##############################################################
39 # 4: check that duplicate marks are included twice in the get_marks reply
40 ##############################################################
41
42 cmd 'open';
43 cmd 'mark bar';
44
45 cmd 'open';
46 cmd 'mark bar';
47
48 is_deeply(get_marks(), [ 'bar', 'bar' ], 'duplicate mark found twice');
49
50 done_testing;