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 # Tests that the border widths can be set separately for floating and
20 # Bug still in: 4.7.2-166-gb69b3fc
22 use i3test i3_autostart => 0;
24 #####################################################################
25 # 1: check that the border widths can be different for floating and
27 #####################################################################
31 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
37 my $pid = launch_with_config($config);
39 my $tmp = fresh_workspace;
41 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
43 my $tilewindow = open_window;
44 my $floatwindow = open_floating_window;
46 my $wscontent = get_ws($tmp);
48 my @tiled = @{$wscontent->{nodes}};
49 ok(@tiled == 1, 'one tiled container opened');
50 is($tilewindow->rect->width, $tiled[0]->{rect}->{width} - 2*5, 'tiled border width 5');
52 my @floating = @{$wscontent->{floating_nodes}};
53 ok(@floating == 1, 'one floating container opened');
54 is($floatwindow->rect->width, $floating[0]->{rect}->{width} - 2*10, 'floating border width 10');
56 exit_gracefully($pid);
58 #####################################################################
59 # 2: make sure the order can also be reverse
60 #####################################################################
64 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
70 $pid = launch_with_config($config);
72 $tmp = fresh_workspace;
74 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
76 $tilewindow = open_window;
77 $floatwindow = open_floating_window;
79 $wscontent = get_ws($tmp);
81 @tiled = @{$wscontent->{nodes}};
82 ok(@tiled == 1, 'one tiled container opened');
83 is($tilewindow->rect->width, $tiled[0]->{rect}->{width} - 2*3, 'tiled border width 3');
85 @floating = @{$wscontent->{floating_nodes}};
86 ok(@floating == 1, 'one floating container opened');
87 is($floatwindow->rect->width, $floating[0]->{rect}->{width} - 2*7, 'floating border width 7');
89 exit_gracefully($pid);