]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/187-commands-parser.t
Add --no-auto-back-and-forth for moving windows.
[i3/i3] / testcases / t / 187-commands-parser.t
index 6d67731a1e71a9914485962ebc3fc73215d1b042..e3481b0a14d47812a1fa0d732d083f82a0d87a98 100644 (file)
@@ -44,7 +44,7 @@ sub parser_calls {
 # The first call has only a single command, the following ones are consolidated
 # for performance.
 is(parser_calls('move workspace 3'),
-   'cmd_move_con_to_workspace_name(3)',
+   'cmd_move_con_to_workspace_name(3, (null))',
    'single number (move workspace 3) ok');
 
 is(parser_calls(
@@ -57,19 +57,19 @@ is(parser_calls(
    'move workspace 3: foobar; ' .
    'move workspace "3: foobar"; ' .
    'move workspace "3: foobar, baz"; '),
-   "cmd_move_con_to_workspace_name(3)\n" .
-   "cmd_move_con_to_workspace_name(3)\n" .
-   "cmd_move_con_to_workspace_name(3)\n" .
-   "cmd_move_con_to_workspace_name(foobar)\n" .
-   "cmd_move_con_to_workspace_name(torrent)\n" .
+   "cmd_move_con_to_workspace_name(3, (null))\n" .
+   "cmd_move_con_to_workspace_name(3, (null))\n" .
+   "cmd_move_con_to_workspace_name(3, (null))\n" .
+   "cmd_move_con_to_workspace_name(foobar, (null))\n" .
+   "cmd_move_con_to_workspace_name(torrent, (null))\n" .
    "cmd_move_workspace_to_output(LVDS1)\n" .
-   "cmd_move_con_to_workspace_name(3: foobar)\n" .
-   "cmd_move_con_to_workspace_name(3: foobar)\n" .
-   "cmd_move_con_to_workspace_name(3: foobar, baz)",
+   "cmd_move_con_to_workspace_name(3: foobar, (null))\n" .
+   "cmd_move_con_to_workspace_name(3: foobar, (null))\n" .
+   "cmd_move_con_to_workspace_name(3: foobar, baz, (null))",
    'move ok');
 
 is(parser_calls('move workspace 3: foobar, nop foo'),
-   "cmd_move_con_to_workspace_name(3: foobar)\n" .
+   "cmd_move_con_to_workspace_name(3: foobar, (null))\n" .
    "cmd_nop(foo)",
    'multiple ops (move workspace 3: foobar, nop foo) ok');
 
@@ -131,11 +131,11 @@ is(parser_calls('[con_mark="yay"] focus'),
 # commands being parsed due to the configuration, people might send IPC
 # commands with leading or trailing newlines.
 is(parser_calls("workspace test\n"),
-   'cmd_workspace_name(test)',
+   'cmd_workspace_name(test, (null))',
    'trailing whitespace stripped off ok');
 
 is(parser_calls("\nworkspace test"),
-   'cmd_workspace_name(test)',
+   'cmd_workspace_name(test, (null))',
    'trailing whitespace stripped off ok');
 
 ################################################################################
@@ -144,13 +144,40 @@ is(parser_calls("\nworkspace test"),
 ################################################################################
 
 is(parser_calls('unknown_literal'),
-   "ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'mode', 'bar'\n" .
+   "ERROR: Expected one of these tokens: <end>, '[', " .
+   "'move', " .
+   "'exec', " .
+   "'exit', " .
+   "'restart', " .
+   "'reload', " .
+   "'shmlog', " .
+   "'debuglog', " .
+   "'border', " .
+   "'layout', " .
+   "'append_layout', " .
+   "'workspace', " .
+   "'focus', " .
+   "'kill', " .
+   "'open', " .
+   "'fullscreen', " .
+   "'sticky', " .
+   "'split', " .
+   "'floating', " .
+   "'mark', " .
+   "'unmark', " .
+   "'resize', " .
+   "'rename', " .
+   "'nop', " .
+   "'scratchpad', " .
+   "'title_format', " .
+   "'mode', " .
+   "'bar'\n" .
    "ERROR: Your command: unknown_literal\n" .
    "ERROR:               ^^^^^^^^^^^^^^^",
    'error for unknown literal ok');
 
 is(parser_calls('move something to somewhere'),
-   "ERROR: Expected one of these tokens: 'window', 'container', 'to', 'workspace', 'output', 'scratchpad', 'left', 'right', 'up', 'down', 'position', 'absolute'\n" .
+   "ERROR: Expected one of these tokens: 'window', 'container', 'to', '--no-auto-back-and-forth', 'workspace', 'output', 'mark', 'scratchpad', 'left', 'right', 'up', 'down', 'position', 'absolute'\n" .
    "ERROR: Your command: move something to somewhere\n" .
    "ERROR:                    ^^^^^^^^^^^^^^^^^^^^^^",
    'error for unknown literal ok');
@@ -160,27 +187,27 @@ is(parser_calls('move something to somewhere'),
 ################################################################################
 
 is(parser_calls('workspace "foo"'),
-   'cmd_workspace_name(foo)',
+   'cmd_workspace_name(foo, (null))',
    'Command with simple double quotes ok');
 
 is(parser_calls('workspace "foo'),
-   'cmd_workspace_name(foo)',
+   'cmd_workspace_name(foo, (null))',
    'Command without ending double quotes ok');
 
 is(parser_calls('workspace "foo \"bar"'),
-   'cmd_workspace_name(foo "bar)',
+   'cmd_workspace_name(foo "bar, (null))',
    'Command with escaped double quotes ok');
 
 is(parser_calls('workspace "foo \\'),
-   'cmd_workspace_name(foo \\)',
+   'cmd_workspace_name(foo \\, (null))',
    'Command with single backslash in the end ok');
 
 is(parser_calls('workspace "foo\\\\bar"'),
-   'cmd_workspace_name(foo\\bar)',
+   'cmd_workspace_name(foo\\bar, (null))',
    'Command with escaped backslashes ok');
 
 is(parser_calls('workspace "foo\\\\\\"bar"'),
-   'cmd_workspace_name(foo\\"bar)',
+   'cmd_workspace_name(foo\\"bar, (null))',
    'Command with escaped double quotes after escaped backslashes ok');
 
 ################################################################################
@@ -189,7 +216,7 @@ is(parser_calls('workspace "foo\\\\\\"bar"'),
 ################################################################################
 
 is(parser_calls("resize shrink width 10 px or"),
-   "ERROR: Expected one of these tokens: <word>\n" .
+   "ERROR: Expected one of these tokens: <number>\n" .
    "ERROR: Your command: resize shrink width 10 px or\n" .
    "ERROR:                                           ",
    "error for resize command with incomplete 'or'-construction ok");