2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://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 # Make sure that configs that end without a newline don't crash i3.
19 use i3test i3_autostart => 0;
21 my $first_lines = <<'EOT';
22 set $workspace1 workspace number 1
23 set $workspace0 workspace eggs
25 bindsym Mod4+1 $workspace1
28 # Intentionally don't add a trailing newline for the last line since this is
29 # what triggered the bug.
30 my $last_line = 'bindsym Mod4+0 $workspace0';
31 my $config = "${first_lines}${last_line}";
33 my $pid = launch_with_config($config);
36 my $i3 = i3(get_socket_path());
37 my $ws = $i3->get_workspaces->recv;
38 is($ws->[0]->{name}, 'eggs', 'last line processed correctly');
40 exit_gracefully($pid);