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($tiled[0]->{current_border_width}, 5, 'tiled current border width set to 5');
51 is($tilewindow->rect->width, $tiled[0]->{rect}->{width} - 2*5, 'tiled border width 5');
53 my @floating = @{$wscontent->{floating_nodes}};
54 ok(@floating == 1, 'one floating container opened');
55 is($floating[0]->{nodes}[0]->{current_border_width}, 10, 'floating current border width set to 10');
56 is($floatwindow->rect->width, $floating[0]->{rect}->{width} - 2*10, 'floating border width 10');
58 exit_gracefully($pid);
60 #####################################################################
61 # 2: make sure the order can also be reverse
62 #####################################################################
66 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
72 $pid = launch_with_config($config);
74 $tmp = fresh_workspace;
76 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
78 $tilewindow = open_window;
79 $floatwindow = open_floating_window;
81 $wscontent = get_ws($tmp);
83 @tiled = @{$wscontent->{nodes}};
84 ok(@tiled == 1, 'one tiled container opened');
85 is($tiled[0]->{current_border_width}, 3, 'tiled current border width set to 3');
86 is($tilewindow->rect->width, $tiled[0]->{rect}->{width} - 2*3, 'tiled border width 3');
88 @floating = @{$wscontent->{floating_nodes}};
89 ok(@floating == 1, 'one floating container opened');
90 is($floating[0]->{nodes}[0]->{current_border_width}, 7, 'floating current border width set to 7');
91 is($floatwindow->rect->width, $floating[0]->{rect}->{width} - 2*7, 'floating border width 7');
93 exit_gracefully($pid);
95 #####################################################################
96 # 3: make sure normal border widths work as well
97 #####################################################################
100 # i3 config file (v4)
101 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
107 $pid = launch_with_config($config);
109 $tmp = fresh_workspace;
111 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
113 $tilewindow = open_window;
114 $floatwindow = open_floating_window;
116 $wscontent = get_ws($tmp);
118 @tiled = @{$wscontent->{nodes}};
119 ok(@tiled == 1, 'one tiled container opened');
120 is($tiled[0]->{current_border_width}, 4, 'tiled current border width set to 4');
121 is($tilewindow->rect->width, $tiled[0]->{rect}->{width} - 2*4, 'tiled border width 4');
123 @floating = @{$wscontent->{floating_nodes}};
124 ok(@floating == 1, 'one floating container opened');
125 is($floating[0]->{nodes}[0]->{current_border_width}, 6, 'floating current border width set to 6');
126 is($floatwindow->rect->width, $floating[0]->{rect}->{width} - 2*6, 'floating border width 6');
128 exit_gracefully($pid);