]> git.sur5r.net Git - i3/i3/blob - testcases/t/271-for_window_tilingfloating.t
tests: use i3_config arg instead of precisely one launch_with_config
[i3/i3] / testcases / t / 271-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_config => <<EOT;
18 # i3 config file (v4)
19 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
20 for_window [tiling] mark tiled
21 for_window [floating] mark floated
22 EOT
23 use X11::XCB qw(PROP_MODE_REPLACE);
24
25 ##############################################################
26 # 13: check that the tiling / floating criteria work.
27 ##############################################################
28
29 my $tmp = fresh_workspace;
30
31 open_window;
32 open_floating_window;
33
34 my @nodes = @{get_ws($tmp)->{nodes}};
35 cmp_ok(@nodes, '==', 1, 'one tiling container on this workspace');
36 is_deeply($nodes[0]->{marks}, [ 'tiled' ], "mark set for 'tiling' criterion");
37
38 @nodes = @{get_ws($tmp)->{floating_nodes}};
39 cmp_ok(@nodes, '==', 1, 'one floating container on this workspace');
40 is_deeply($nodes[0]->{nodes}[0]->{marks}, [ 'floated' ], "mark set for 'floating' criterion");
41
42 ##############################################################
43
44 done_testing;