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 # Verifies that i3 removes swallows specifications for split containers.
18 # ticket #1149, bug still present in commit 2fea5ef82bd3528ed62681f9ac64f45830f4acdf
20 use File::Temp qw(tempfile);
23 my $ws = fresh_workspace;
25 my @content = @{get_ws_content($ws)};
26 is(@content, 0, 'no nodes on the new workspace yet');
28 my ($fh, $filename) = tempfile(UNLINK => 1);
33 "floating": "auto_off",
41 "percent": 0.116145833333333,
45 "window_role": "^buddy_list$"
52 // splitv split container with 1 children
54 "floating": "auto_off",
56 "percent": 0.883854166666667,
60 // splitv split container with 2 children
62 "floating": "auto_off",
69 "floating": "auto_off",
88 "floating": "auto_off",
95 "name": "Michael Stapelberg",
100 "window_role": "^conversation$"
112 my $reply = cmd "append_layout $filename";
116 ok($reply->[0]->{success}, 'IPC reply indicates success');
118 my @nodes = @{get_ws_content($ws)};
120 is_deeply($nodes[0]->{swallows},
124 window_role => '^buddy_list$',
127 'swallows specification not parsed correctly');
129 is_deeply($nodes[1]->{swallows},
131 'swallows specification empty on split container');
133 my @children = @{$nodes[1]->{nodes}->[0]->{nodes}};
135 is_deeply($children[0]->{swallows},
142 'swallows specification not parsed correctly');
144 is_deeply($children[1]->{swallows},
148 window_role => '^conversation$',
151 'swallows specification not parsed correctly');