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 does not crash when a layout is partially loadable.
18 # ticket #1145, bug still present in commit b109b1b20dd51401dc929407453d3acdd8ff5566
20 use File::Temp qw(tempfile);
23 ################################################################################
25 ################################################################################
27 my ($fh, $filename) = tempfile(UNLINK => 1);
28 cmd "append_layout $filename";
34 ################################################################################
35 # file with a superfluous trailing comma
36 ################################################################################
38 my $ws = fresh_workspace;
40 my @content = @{get_ws_content($ws)};
41 is(@content, 0, 'no nodes on the new workspace yet');
43 ($fh, $filename) = tempfile(UNLINK => 1);
48 "floating": "auto_off",
56 "percent": 0.116145833333333,
60 "window_role": "^buddy_list$"
67 // splitv split container with 1 children
69 "floating": "auto_off",
71 "percent": 0.883854166666667,
78 // splitv split container with 2 children
80 "floating": "auto_off",
90 "floating": "auto_off",
109 "floating": "auto_off",
116 "name": "Michael Stapelberg",
121 "window_role": "^conversation$"
133 my $reply = cmd "append_layout $filename";
134 diag('reply = ' . Dumper($reply));
138 ok(!$reply->[0]->{success}, 'IPC reply did not indicate success');
142 ################################################################################
143 # wrong percent key in a child node
144 ################################################################################
146 $ws = fresh_workspace;
148 @content = @{get_ws_content($ws)};
149 is(@content, 0, 'no nodes on the new workspace yet');
151 ($fh, $filename) = tempfile(UNLINK => 1);
156 "floating": "auto_off",
162 "floating": "auto_off",
184 cmd "append_layout $filename";