2 # vim:ts=4:sw=4:expandtab
3 # Check if numbered workspaces and named workspaces are sorted in the right way
4 # in get_workspaces IPC output (necessary for i3bar etc.).
7 my $i3 = i3(get_socket_path());
12 my @ws = @{$i3->get_workspaces->recv};
13 my @nums = map { $_->{num} } grep { defined($_->{num}) } @ws;
14 my @sorted = sort @nums;
16 is_deeply(\@nums, \@sorted, $msg);
19 check_order('workspace order alright before testing');
21 #############################################################################
22 # open a window to keep this ws open
23 #############################################################################
29 my @ws = @{$i3->get_workspaces->recv};
30 my @f = grep { defined($_->{num}) && $_->{num} == 93 } @ws;
31 is(@f, 1, 'ws 93 found by num');
32 check_order('workspace order alright after opening 93');
36 check_order('workspace order alright after opening 92');
40 check_order('workspace order alright after opening 94');
44 check_order('workspace order alright after opening 96');
48 check_order('workspace order alright after opening foo');
52 check_order('workspace order alright after opening 91');