]> git.sur5r.net Git - i3/i3/blob - testcases/t/203-regress-assign-and-move.t
Merge branch 'next' into master
[i3/i3] / testcases / t / 203-regress-assign-and-move.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 # Verifies that you can assign a window _and_ use for_window with a move
18 # command.
19 # Ticket: #909
20 # Bug still in: 4.4-69-g6856b23
21 use i3test i3_autostart => 0;
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 assign [instance=__i3-test-window] 2
28 for_window [instance=__i3-test-window] move workspace 1
29 EOT
30
31 my $pid = launch_with_config($config);
32
33 # We use dont_map because i3 will not map the window on the current
34 # workspace. Thus, open_window would time out in wait_for_map (2 seconds).
35 my $window = open_window(
36     wm_class => '__i3-test-window',
37     dont_map => 1,
38 );
39 $window->map;
40
41 does_i3_live;
42
43 exit_gracefully($pid);
44
45 ################################################################################
46 # Related bug: multiple for_window assignments caused a crash
47 ################################################################################
48
49 $config = <<EOT;
50 # i3 config file (v4)
51 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
52
53 for_window [instance=__i3-test-window1] move workspace 3
54 for_window [instance=__i3-test-window2] move workspace 2
55 EOT
56
57 $pid = launch_with_config($config);
58
59 my $window1 = open_window(
60     wm_class => '__i3-test-window1',
61     dont_map => 1,
62 );
63 $window1->map;
64
65 my $window2 = open_window(
66     wm_class => '__i3-test-window2',
67     dont_map => 1,
68 );
69 $window2->map;
70
71 does_i3_live;
72
73 exit_gracefully($pid);
74
75 done_testing;