#!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) # # Tests the new_window and new_float config option. # use i3test i3_autostart => 0; ##################################################################### # 1: check that new windows start with 'normal' border unless configured # otherwise ##################################################################### my $config = <{border}, 'normal', 'border normal by default'); exit_gracefully($pid); ##################################################################### # 2: check that new tiling windows start with '1pixel' border when # configured ##################################################################### $config = <{border}, 'pixel', 'border pixel by default'); is($content[0]->{current_border_width}, 1, 'border width pixels 1 (default)'); exit_gracefully($pid); ##################################################################### # 3: check that new floating windows start with 'normal' border unless # configured otherwise ##################################################################### $config = <{floating_nodes}}; ok(@floating == 1, 'one floating container opened'); my $floatingcon = $floating[0]; is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default'); exit_gracefully($pid); ##################################################################### # 4: check that new floating windows start with '1pixel' border when # configured ##################################################################### $config = <{floating_nodes}}; ok(@floating == 1, 'one floating container opened'); $floatingcon = $floating[0]; is($floatingcon->{nodes}->[0]->{border}, 'pixel', 'border pixel by default'); exit_gracefully($pid); done_testing;