]> git.sur5r.net Git - i3/i3/blob - testcases/t/20-multiple-cmds.t
bugfix: don’t clean up workspace when switching to the same workspace
[i3/i3] / testcases / t / 20-multiple-cmds.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Tests multiple commands (using ';') and multiple operations (using ',')
5 #
6 use i3test tests => 24;
7 use X11::XCB qw(:all);
8 use v5.10;
9
10 my $i3 = i3("/tmp/nestedcons");
11
12 my $tmp = get_unused_workspace();
13 $i3->command("workspace $tmp")->recv;
14
15 sub multiple_cmds {
16     my ($cmd) = @_;
17
18     $i3->command('open')->recv;
19     $i3->command('open')->recv;
20     ok(@{get_ws_content($tmp)} == 2, 'two containers opened');
21
22     $i3->command($cmd)->recv;
23     ok(@{get_ws_content($tmp)} == 0, "both containers killed (cmd = $cmd)");
24 }
25 multiple_cmds('kill;kill');
26 multiple_cmds('kill; kill');
27 multiple_cmds('kill ; kill');
28 multiple_cmds('kill ;kill');
29 multiple_cmds('kill  ;kill');
30 multiple_cmds('kill  ;  kill');
31 multiple_cmds("kill;\tkill");
32 multiple_cmds("kill\t;kill");
33 multiple_cmds("kill\t;\tkill");
34 multiple_cmds("kill\t ;\tkill");
35 multiple_cmds("kill\t ;\t kill");
36 multiple_cmds("kill \t ; \t kill");
37
38 # TODO: need a non-invasive command before implementing a test which uses ','
39
40 diag( "Testing i3, Perl $], $^X" );