]> git.sur5r.net Git - i3/i3/blob - testcases/t/165-for_window_tilingfloating.t
165-for_window: merge config and re-use i3 instance, split remainder
[i3/i3] / testcases / t / 165-for_window_tilingfloating.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://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 use i3test i3_autostart => 0;
18 use X11::XCB qw(PROP_MODE_REPLACE);
19
20 ##############################################################
21 # 13: check that the tiling / floating criteria work.
22 ##############################################################
23
24 my $config = <<"EOT";
25 # i3 config file (v4)
26 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
27 for_window [tiling] mark tiled
28 for_window [floating] mark floated
29 EOT
30
31 my $pid = launch_with_config($config);
32 my $tmp = fresh_workspace;
33
34 open_window;
35 open_floating_window;
36
37 my @nodes = @{get_ws($tmp)->{nodes}};
38 cmp_ok(@nodes, '==', 1, 'one tiling container on this workspace');
39 is_deeply($nodes[0]->{marks}, [ 'tiled' ], "mark set for 'tiling' criterion");
40
41 @nodes = @{get_ws($tmp)->{floating_nodes}};
42 cmp_ok(@nodes, '==', 1, 'one floating container on this workspace');
43 is_deeply($nodes[0]->{nodes}[0]->{marks}, [ 'floated' ], "mark set for 'floating' criterion");
44
45 exit_gracefully($pid);
46
47 ##############################################################
48
49 done_testing;