2 # vim:ts=4:sw=4:expandtab
4 # Tests multiple commands (using ';') and multiple operations (using ',')
8 my $tmp = fresh_workspace;
15 ok(@{get_ws_content($tmp)} == 2, 'two containers opened');
18 ok(@{get_ws_content($tmp)} == 0, "both containers killed (cmd = $cmd)");
20 multiple_cmds('kill;kill');
21 multiple_cmds('kill; kill');
22 multiple_cmds('kill ; kill');
23 multiple_cmds('kill ;kill');
24 multiple_cmds('kill ;kill');
25 multiple_cmds('kill ; kill');
26 multiple_cmds("kill;\tkill");
27 multiple_cmds("kill\t;kill");
28 multiple_cmds("kill\t;\tkill");
29 multiple_cmds("kill\t ;\tkill");
30 multiple_cmds("kill\t ;\t kill");
31 multiple_cmds("kill \t ; \t kill");
33 #####################################################################
34 # test if un-quoted strings are handled correctly
35 #####################################################################
37 $tmp = fresh_workspace;
39 my $unused = get_unused_workspace;
40 ok(!($unused ~~ @{get_workspace_names()}), 'workspace does not exist yet');
41 cmd "move workspace $unused; nop parser test";
42 ok(($unused ~~ @{get_workspace_names()}), 'workspace exists after moving');
44 #####################################################################
45 # quote the workspace name and use a ; (command separator) in its name
46 #####################################################################
49 $unused = get_unused_workspace;
51 ok(!($unused ~~ @{get_workspace_names()}), 'workspace does not exist yet');
52 cmd qq|move workspace "$unused"; nop parser test|;
53 ok(($unused ~~ @{get_workspace_names()}), 'workspace exists after moving');
55 # TODO: need a non-invasive command before implementing a test which uses ','
57 ################################################################################
58 # regression test: 10 invalid commands should not crash i3 (10 is the stack
60 ################################################################################
62 cmd 'move gibberish' for (0 .. 10);
66 ################################################################################
67 # regression test: an invalid command should come back with an error.
68 ################################################################################
70 my $reply = cmd 'bullshit-command-which-we-never-implement meh';
71 is(scalar @$reply, 1, 'got one command reply');
72 ok(!$reply->[0]->{success}, 'reply has success == false');