2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://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 # Verifies that the size requested by floating windows is set by i3, no matter
18 # to which value the new_window option is set.
19 # ticket #770, bug still present in commit ae88accf6fe3817ff42d0d51be1965071194766e
20 use i3test i3_autostart => 0;
22 sub test_with_config {
27 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
30 if (defined($value)) {
31 $config .= "$value\n";
32 diag("testing with $value");
34 diag("testing without new_window");
37 my $pid = launch_with_config($config);
39 my $tmp = fresh_workspace;
41 my $window = open_floating_window({ rect => [ 0, 0, 400, 150 ] });
43 my ($absolute, $top) = $window->rect;
45 ok($window->mapped, 'Window is mapped');
46 cmp_ok($absolute->{width}, '==', 400, 'requested width kept');
47 cmp_ok($absolute->{height}, '==', 150, 'requested height kept');
49 exit_gracefully($pid);
52 test_with_config(undef);
53 test_with_config('new_window 1pixel');
54 test_with_config('new_window normal');
55 test_with_config('new_window none');
56 test_with_config('hide_edge_borders both');