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,
63 // splitv split container with 2 children
65 "floating": "auto_off",
75 "floating": "auto_off",
94 "floating": "auto_off",
101 "name": "Michael Stapelberg",
106 "window_role": "^conversation$"
118 my $reply = cmd "append_layout $filename";
122 ok($reply->[0]->{success}, 'IPC reply indicates success');
124 my @nodes = @{get_ws_content($ws)};
126 is_deeply($nodes[0]->{swallows},
130 window_role => '^buddy_list$',
133 'swallows specification not parsed correctly');
135 is_deeply($nodes[1]->{swallows},
137 'swallows specification empty on split container');
139 my @children = @{$nodes[1]->{nodes}->[0]->{nodes}};
141 is_deeply($children[0]->{swallows},
148 'swallows specification not parsed correctly');
150 is_deeply($children[1]->{swallows},
154 window_role => '^conversation$',
157 'swallows specification not parsed correctly');