aboutsummaryrefslogtreecommitdiff
path: root/testcases/t/161-regress-borders-restart.t
blob: 0b45df0607bd99edb4393a99ae81485cca478cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!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)
#
# Regression test to check if borders are correctly restored after an inplace
# restart.
# found in eb8ad348b28e243cba1972e802ca8ee636472fc9
#
use List::Util qw(first);
use i3test;

my $i3 = i3(get_socket_path());
my $tmp = fresh_workspace;
my $window = open_window;

sub get_border_style {
    my @content = @{get_ws_content($tmp)};
    my $wininfo = first { $_->{window} == $window->id } @content;

    return $wininfo->{border};
}

is(get_border_style(), 'normal', 'border style normal');

cmd 'border 1pixel';

is(get_border_style(), 'pixel', 'border style 1pixel after changing');

# perform an inplace-restart
cmd 'restart';

does_i3_live;

is(get_border_style(), 'pixel', 'border style still 1pixel after restart');

done_testing;