#!perl # vim:ts=4:sw=4:expandtab # # Please read the following documents before working on tests: # • https://build.i3wm.org/docs/testsuite.html # (or docs/testsuite) # # • https://build.i3wm.org/docs/lib-i3test.html # (alternatively: perldoc ./testcases/lib/i3test.pm) # # • https://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) # # Test assignments of workspaces to outputs. use i3test i3_autostart => 0; ################################################################################ # Test initial workspaces. ################################################################################ my $config = <$output] " . $msg); } check_output('9', '', 'Numbered workspace with a big number that is assigned to output that does not exist is not used'); check_output('special', 'fake-0', 'Output gets special workspace because of assignment'); check_output('bindingname', 'fake-1', 'Bindings give workspace names'); check_output('1', 'fake-2', 'Numbered workspace that is assigned to output that does not exist is used'); check_output('2', '', 'Numbered workspace assigned to output with existing workspace is not used'); check_output('3', '', 'Numbered workspace assigned to output with existing workspace is not used'); check_output('4', 'fake-3', 'First available number that is not assigned to existing output is used'); check_output('dontusethisname', '', 'Named workspace that is assigned to output that does not exist is not used'); check_output('donotoverride', '', 'Named workspace assigned to already occupied output is not used'); exit_gracefully($pid); ################################################################################ # Test multiple assignments ################################################################################ sub do_test { my ($workspace, $output, $msg) = @_; cmd 'focus output ' . ($output eq 'fake-3' ? 'fake-0' : 'fake-3'); cmd "workspace $workspace"; check_output($workspace, $output, $msg) } $config = <