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 # Tests the standalone parser binary to see if it calls the right code when
18 # confronted with various commands, if it prints proper error messages for
19 # wrong commands and if it terminates in every case.
21 use i3test i3_autostart => 0;
28 run [ '../test.config_parser', $command ],
31 # TODO: use a timeout, so that we can error out if it doesn’t terminate
33 # Filter out all debugging output.
34 my @lines = split("\n", $stdout);
35 @lines = grep { not /^# / } @lines;
37 ## The criteria management calls are irrelevant and not what we want to test
38 ## in the first place.
39 #@lines = grep { !(/cmd_criteria_init()/ || /cmd_criteria_match_windows/) } @lines;
40 return join("\n", @lines) . "\n";
45 bindsym Mod1 + Shift + x resize grow
46 bindcode Mod1+44 resize shrink
50 my $expected = <<'EOT';
52 cfg_mode_binding(bindsym, Mod1,Shift, x, resize grow)
53 cfg_mode_binding(bindcode, Mod1, 44, resize shrink)
56 is(parser_calls($config),
58 'single number (move workspace 3) ok');
62 exec --no-startup-id /tmp/foo.sh
64 exec_always --no-startup-id /tmp/bar.sh
68 cfg_exec(exec, (null), geeqie)
69 cfg_exec(exec, --no-startup-id, /tmp/foo.sh)
70 cfg_exec(exec_always, (null), firefox)
71 cfg_exec(exec_always, --no-startup-id, /tmp/bar.sh)
74 is(parser_calls($config),
76 'single number (move workspace 3) ok');