X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Ft%2F201-config-parser.t;h=d3da42354ba4e012cb2a3fb2c2c5ca6374c09f9b;hb=4bec3b9d24fe0bd7bab4792497bbd02bffaa6620;hp=182d7754bc7f3d805f4a342a5238679089e98595;hpb=d5358a749e3f4eed45144a2c78032c4163ea2367;p=i3%2Fi3 diff --git a/testcases/t/201-config-parser.t b/testcases/t/201-config-parser.t index 182d7754..d3da4235 100644 --- a/testcases/t/201-config-parser.t +++ b/testcases/t/201-config-parser.t @@ -45,19 +45,27 @@ mode "meh" { bindsym Mod1 + Shift + x resize grow bindcode Mod1+44 resize shrink bindsym --release Mod1+x exec foo + bindsym --whole-window button3 nop + bindsym --release --whole-window button3 nop + bindsym --border button3 nop + bindsym --release --border button3 nop } EOT my $expected = <<'EOT'; -cfg_enter_mode(meh) -cfg_mode_binding(bindsym, Mod1,Shift, x, (null), resize grow) -cfg_mode_binding(bindcode, Mod1, 44, (null), resize shrink) -cfg_mode_binding(bindsym, Mod1, x, --release, exec foo) +cfg_enter_mode((null), meh) +cfg_mode_binding(bindsym, Mod1,Shift, x, (null), (null), (null), resize grow) +cfg_mode_binding(bindcode, Mod1, 44, (null), (null), (null), resize shrink) +cfg_mode_binding(bindsym, Mod1, x, --release, (null), (null), exec foo) +cfg_mode_binding(bindsym, (null), button3, (null), (null), --whole-window, nop) +cfg_mode_binding(bindsym, (null), button3, --release, (null), --whole-window, nop) +cfg_mode_binding(bindsym, (null), button3, (null), --border, (null), nop) +cfg_mode_binding(bindsym, (null), button3, --release, --border, (null), nop) EOT is(parser_calls($config), $expected, - 'single number (move workspace 3) ok'); + 'mode bindings ok'); ################################################################################ # exec and exec_always @@ -144,6 +152,27 @@ is(parser_calls($config), $expected, 'floating_minimum_size ok'); +################################################################################ +# popup_during_fullscreen +################################################################################ + +$config = <<'EOT'; +popup_during_fullscreen ignore +popup_during_fullscreen leave_fullscreen +popup_during_fullscreen SMArt +EOT + +$expected = <<'EOT'; +cfg_popup_during_fullscreen(ignore) +cfg_popup_during_fullscreen(leave_fullscreen) +cfg_popup_during_fullscreen(smart) +EOT + +is(parser_calls($config), + $expected, + 'popup_during_fullscreen ok'); + + ################################################################################ # floating_modifier ################################################################################ @@ -257,6 +286,7 @@ hide_edge_borders none hide_edge_borders vertical hide_edge_borders horizontal hide_edge_borders both +hide_edge_borders smart EOT $expected = <<'EOT'; @@ -264,6 +294,7 @@ cfg_hide_edge_borders(none) cfg_hide_edge_borders(vertical) cfg_hide_edge_borders(horizontal) cfg_hide_edge_borders(both) +cfg_hide_edge_borders(smart) EOT is(parser_calls($config), @@ -288,6 +319,24 @@ is(parser_calls($config), $expected, 'focus_follows_mouse ok'); +################################################################################ +# mouse_warping +################################################################################ + +$config = <<'EOT'; +mouse_warping output +mouse_warping none +EOT + +$expected = <<'EOT'; +cfg_mouse_warping(output) +cfg_mouse_warping(none) +EOT + +is(parser_calls($config), + $expected, + 'mouse_warping ok'); + ################################################################################ # force_display_urgency_hint ################################################################################ @@ -365,17 +414,19 @@ is(parser_calls($config), ################################################################################ $config = <<'EOT'; -client.focused #4c7899 #285577 #ffffff #2e9ef4 +client.focused #4c7899 #285577 #ffffff #2e9ef4 #b34d4c client.focused_inactive #333333 #5f676a #ffffff #484e50 client.unfocused #333333 #222222 #888888 #292d2e -client.urgent #2f343a #900000 #ffffff #900000 +client.urgent #2f343a #900000 #ffffff #900000 #c00000 +client.placeholder #000000 #0c0c0c #ffffff #000000 EOT $expected = <<'EOT'; -cfg_color(client.focused, #4c7899, #285577, #ffffff, #2e9ef4) -cfg_color(client.focused_inactive, #333333, #5f676a, #ffffff, #484e50) -cfg_color(client.unfocused, #333333, #222222, #888888, #292d2e) -cfg_color(client.urgent, #2f343a, #900000, #ffffff, #900000) +cfg_color(client.focused, #4c7899, #285577, #ffffff, #2e9ef4, #b34d4c) +cfg_color(client.focused_inactive, #333333, #5f676a, #ffffff, #484e50, NULL) +cfg_color(client.unfocused, #333333, #222222, #888888, #292d2e, NULL) +cfg_color(client.urgent, #2f343a, #900000, #ffffff, #900000, #c00000) +cfg_color(client.placeholder, #000000, #0c0c0c, #ffffff, #000000, NULL) EOT is(parser_calls($config), @@ -392,7 +443,7 @@ client.focused #4c7899 #285577 #ffffff #2e9ef4 EOT my $expected_all_tokens = <<'EOT'; -ERROR: CONFIG: Expected one of these tokens: , '#', 'set', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'new_window', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'focus_follows_mouse', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'workspace', 'ipc_socket', 'ipc-socket', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent' +ERROR: CONFIG: Expected one of these tokens: , '#', 'set', 'set_from_resource', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'new_window', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'no_focus', 'focus_follows_mouse', 'mouse_warping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'focus_on_window_activation', 'show_marks', 'workspace', 'ipc_socket', 'ipc-socket', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder' EOT my $expected_end = <<'EOT'; @@ -400,7 +451,7 @@ ERROR: CONFIG: (in file ) ERROR: CONFIG: Line 1: hide_edge_border both ERROR: CONFIG: ^^^^^^^^^^^^^^^^^^^^^ ERROR: CONFIG: Line 2: client.focused #4c7899 #285577 #ffffff #2e9ef4 -cfg_color(client.focused, #4c7899, #285577, #ffffff, #2e9ef4) +cfg_color(client.focused, #4c7899, #285577, #ffffff, #2e9ef4, NULL) EOT $expected = $expected_all_tokens . $expected_end; @@ -415,18 +466,33 @@ client.focused #4c7899 #285577 #ffffff #2e9ef4 EOT $expected = <<'EOT'; -ERROR: CONFIG: Expected one of these tokens: 'none', 'vertical', 'horizontal', 'both', '1', 'yes', 'true', 'on', 'enable', 'active' +ERROR: CONFIG: Expected one of these tokens: 'none', 'vertical', 'horizontal', 'both', 'smart', '1', 'yes', 'true', 'on', 'enable', 'active' ERROR: CONFIG: (in file ) ERROR: CONFIG: Line 1: hide_edge_borders FOOBAR ERROR: CONFIG: ^^^^^^ ERROR: CONFIG: Line 2: client.focused #4c7899 #285577 #ffffff #2e9ef4 -cfg_color(client.focused, #4c7899, #285577, #ffffff, #2e9ef4) +cfg_color(client.focused, #4c7899, #285577, #ffffff, #2e9ef4, NULL) EOT is(parser_calls($config), $expected, 'errors dont harm subsequent statements'); +################################################################################ +# Regression: semicolons end comments, but shouldn’t +################################################################################ + +$config = <<'EOT'; +# "foo" client.focused #4c7899 #285577 #ffffff #2e9ef4 +EOT + +$expected = <<'EOT'; + +EOT + +is(parser_calls($config), + $expected, + 'semicolon does not end a comment line'); ################################################################################ # Error message with 2+2 lines of context @@ -563,8 +629,8 @@ mode "yo" { EOT $expected = <<'EOT'; -cfg_enter_mode(yo) -cfg_mode_binding(bindsym, (null), x, (null), resize shrink left) +cfg_enter_mode((null), yo) +cfg_mode_binding(bindsym, (null), x, (null), (null), (null), resize shrink left) ERROR: CONFIG: Expected one of these tokens: , '#', 'set', 'bindsym', 'bindcode', 'bind', '}' ERROR: CONFIG: (in file ) ERROR: CONFIG: Line 1: mode "yo" { @@ -590,8 +656,9 @@ bar { EOT $expected = <<'EOT'; +cfg_bar_start() cfg_bar_output(LVDS-1) -ERROR: CONFIG: Expected one of these tokens: , '#', 'set', 'i3bar_command', 'status_command', 'socket_path', 'mode', 'modifier', 'position', 'output', 'tray_output', 'font', 'workspace_buttons', 'verbose', 'colors', '}' +ERROR: CONFIG: Expected one of these tokens: , '#', 'set', 'i3bar_command', 'status_command', 'socket_path', 'mode', 'hidden_state', 'id', 'modifier', 'wheel_up_cmd', 'wheel_down_cmd', 'bindsym', 'position', 'output', 'tray_output', 'tray_padding', 'font', 'separator_symbol', 'binding_mode_indicator', 'workspace_buttons', 'strip_workspace_numbers', 'verbose', 'colors', '}' ERROR: CONFIG: (in file ) ERROR: CONFIG: Line 1: bar { ERROR: CONFIG: Line 2: output LVDS-1