X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Ft%2F504-move-workspace-to-output.t;h=018707e6cf5e522a8527b8b6db57b5e4acc2a600;hb=fcdfab4d280cf469f339ce7168082658b9b76c8c;hp=8357e0dac6429dc29d1c42df39a579584cefea66;hpb=1f682eb9c83535fba90d5f1864a921e72bc9f9b0;p=i3%2Fi3 diff --git a/testcases/t/504-move-workspace-to-output.t b/testcases/t/504-move-workspace-to-output.t index 8357e0da..018707e6 100644 --- a/testcases/t/504-move-workspace-to-output.t +++ b/testcases/t/504-move-workspace-to-output.t @@ -1,6 +1,19 @@ #!perl # vim:ts=4:sw=4:expandtab # +# Please read the following documents before working on tests: +# • http://build.i3wm.org/docs/testsuite.html +# (or docs/testsuite) +# +# • http://build.i3wm.org/docs/lib-i3test.html +# (alternatively: perldoc ./testcases/lib/i3test.pm) +# +# • http://build.i3wm.org/docs/ipc.html +# (or docs/ipc) +# +# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf +# (unless you are already familiar with Perl) +# # Tests whether the 'move workspace to [output] ' command works # use List::Util qw(first); @@ -101,6 +114,16 @@ cmd 'move workspace to output left'; ($x0, $x1) = workspaces_per_screen(); ok('5' ~~ @$x0, 'workspace 5 back on fake-0'); +# Verify that wrapping works +cmd 'move workspace to output left'; +($x0, $x1) = workspaces_per_screen(); +ok('5' ~~ @$x1, 'workspace 5 on fake-1'); + +# Put workspace 5 where it should +cmd 'move workspace to output left'; +($x0, $x1) = workspaces_per_screen(); +ok('5' ~~ @$x0, 'workspace 5 on fake-0 again'); + ################################################################################ # Verify that coordinates of floating windows are fixed correctly when moving a # workspace to a different output. @@ -120,6 +143,26 @@ is($old_rect->{y}, $new_rect->{y}, 'y coordinate unchanged'); is($old_rect->{width}, $new_rect->{width}, 'width unchanged'); is($old_rect->{height}, $new_rect->{height}, 'height unchanged'); +################################################################################ +# Verify that empty workspaces get cleaned up when moving a different workspace +# to that output. +################################################################################ + +my $empty_ws = fresh_workspace(output => 0); +my $other_output_ws = fresh_workspace(output => 1); +cmd 'open'; + +($x0, $x1) = workspaces_per_screen(); +ok($empty_ws ~~ @$x0, 'empty_ws on fake-0'); +ok($other_output_ws ~~ @$x1, 'other_output_ws on fake-1'); + +cmd 'move workspace to output left'; + +($x0, $x1) = workspaces_per_screen(); +ok(!($empty_ws ~~ @$x0), 'empty_ws not on fake-0'); +ok(!($empty_ws ~~ @$x1), 'empty_ws not on fake-1'); +ok($other_output_ws ~~ @$x0, 'other_output_ws on fake-0'); + exit_gracefully($pid); done_testing;