2 # vim:ts=4:sw=4:expandtab
4 # checks if the IPC message type get_marks works correctly
8 # TODO: this will be available in AnyEvent::I3 soon
10 my $i3 = i3(get_socket_path());
12 my $cv = AnyEvent->condvar;
13 my $msg = $i3->message(5);
17 $cv->send($_cv->recv);
19 $t = AnyEvent->timer(after => 2, cb => sub {
20 $cv->croak('timeout while waiting for the marks');
25 ##############################################################
26 # 1: check that get_marks returns no marks yet
27 ##############################################################
29 my $tmp = fresh_workspace;
31 my $marks = get_marks();
32 cmp_deeply($marks, [], 'no marks set so far');
34 ##############################################################
35 # 2: check that setting a mark is reflected in the get_marks reply
36 ##############################################################
41 cmp_deeply(get_marks(), [ 'foo' ], 'mark foo set');
43 ##############################################################
44 # 3: check that the mark is gone after killing the container
45 ##############################################################
49 cmp_deeply(get_marks(), [ ], 'mark gone');
51 ##############################################################
52 # 4: check that duplicate marks are included twice in the get_marks reply
53 ##############################################################
61 cmp_deeply(get_marks(), [ 'bar', 'bar' ], 'duplicate mark found twice');