]> git.sur5r.net Git - i3/i3/blob - testcases/t/262-config-validation.t
Add strip_workspace_name
[i3/i3] / testcases / t / 262-config-validation.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Ensures that calling i3 with the -C switch works (smoke test).
18 # Ticket: #2144
19 use i3test i3_autostart => 0;
20 use POSIX ":sys_wait_h";
21 use Time::HiRes qw(sleep);
22
23 my $config = <<EOT;
24 # i3 config file (v4)
25 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
26
27 invalid
28 EOT
29
30 my $exit_code = launch_with_config($config, validate_config => 1);
31 isnt($exit_code, 0, 'i3 exited with an error code');
32
33 my $log = get_i3_log;
34
35 # We don't care so much about the output (there are tests for this), but rather
36 # that we got correct output at all instead of, e.g., a segfault.
37 ok($log =~ /Expected one of these tokens/, 'an invalid config token was found');
38
39 done_testing;