]> git.sur5r.net Git - i3/i3/blob - testcases/t/254-move-to-output-with-criteria.t
fb832184721f586e2dd04554ae19dc60132ca55e
[i3/i3] / testcases / t / 254-move-to-output-with-criteria.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Verifies that "move container to output" works correctly when
18 # used with command criteria.
19 # Bug still in: 4.10.4-349-gee5db87
20 use i3test i3_autostart => 0;
21
22 my $config = <<EOT;
23 # i3 config file (v4)
24 font pango:monospace 8
25
26 fake-outputs 800x600+0+0,800x600+800+0,800x600+0+600,800x600+800+600
27 EOT
28
29 my $pid = launch_with_config($config);
30
31 my $ws_top_left = fresh_workspace(output => 0);
32 my $ws_top_right = fresh_workspace(output => 1);
33 my $ws_bottom_left = fresh_workspace(output => 2);
34 my $ws_bottom_right = fresh_workspace(output => 3);
35
36 cmd "workspace " . $ws_top_left;
37 open_window(wm_class => 'moveme');
38 cmd "workspace " . $ws_bottom_left;
39 open_window(wm_class => 'moveme');
40
41 cmd '[class="moveme"] move window to output right';
42
43 is_num_children($ws_top_left, 0, 'no containers on the upper left workspace');
44 is_num_children($ws_top_right, 1, 'one container on the upper right workspace');
45 is_num_children($ws_bottom_left, 0, 'no containers on the lower left workspace');
46 is_num_children($ws_bottom_right, 1, 'one container on the lower right workspace');
47
48 exit_gracefully($pid);
49
50 done_testing;