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 # Regression: Check if the focus stays the same when switching the layout
18 # bug introduced by 77d0d42ed2d7ac8cafe267c92b35a81c1b9491eb
21 my $i3 = i3(get_socket_path());
26 my @ws = @{$i3->get_workspaces->recv};
27 my @nums = map { $_->{num} } grep { defined($_->{num}) } @ws;
28 my @sorted = sort @nums;
30 is_deeply(\@nums, \@sorted, $msg);
33 my $tmp = fresh_workspace;
35 my $left = open_window;
36 my $mid = open_window;
37 my $right = open_window;
39 diag("left = " . $left->id . ", mid = " . $mid->id . ", right = " . $right->id);
41 is($x->input_focus, $right->id, 'Right window focused');
45 is($x->input_focus, $mid->id, 'Mid window focused');
49 is($x->input_focus, $mid->id, 'Mid window focused');