]> git.sur5r.net Git - i3/i3/blob - testcases/t/161-regress-borders-restart.t
Merge branch 'fix-baf-after-scratchpad'
[i3/i3] / testcases / t / 161-regress-borders-restart.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Regression test to check if borders are correctly restored after an inplace
18 # restart.
19 # found in eb8ad348b28e243cba1972e802ca8ee636472fc9
20 #
21 use List::Util qw(first);
22 use i3test;
23
24 my $i3 = i3(get_socket_path());
25 my $tmp = fresh_workspace;
26 my $window = open_window;
27
28 sub get_border_style {
29     my @content = @{get_ws_content($tmp)};
30     my $wininfo = first { $_->{window} == $window->id } @content;
31
32     return $wininfo->{border};
33 }
34
35 is(get_border_style(), 'normal', 'border style normal');
36
37 cmd 'border 1pixel';
38
39 is(get_border_style(), '1pixel', 'border style 1pixel after changing');
40
41 # perform an inplace-restart
42 cmd 'restart';
43
44 does_i3_live;
45
46 is(get_border_style(), '1pixel', 'border style still 1pixel after restart');
47
48 done_testing;