X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Ft%2F201-config-parser.t;h=e8080a73480484bfbab7e75c4877ec2c0a4102db;hb=eaf7a49e28b7ff8e1820a1b23350647574a0ed5a;hp=faf2f0db7e907e7c1fcc76101044ef6cb23e7f29;hpb=2b6f76852c3c27fddcbff198960504eba263c007;p=i3%2Fi3 diff --git a/testcases/t/201-config-parser.t b/testcases/t/201-config-parser.t index faf2f0db..e8080a73 100644 --- a/testcases/t/201-config-parser.t +++ b/testcases/t/201-config-parser.t @@ -25,7 +25,7 @@ sub parser_calls { my ($command) = @_; my $stdout; - run [ '../test.config_parser', $command ], + run [ 'test.config_parser', $command ], '>/dev/null', '2>', \$stdout; # TODO: use a timeout, so that we can error out if it doesn’t terminate @@ -49,18 +49,22 @@ mode "meh" { bindsym --release --whole-window button3 nop bindsym --border button3 nop bindsym --release --border button3 nop + bindsym --exclude-titlebar button3 nop + bindsym --whole-window --border --exclude-titlebar button3 nop } EOT my $expected = <<'EOT'; -cfg_enter_mode(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) +cfg_enter_mode((null), meh) +cfg_mode_binding(bindsym, Mod1,Shift, x, (null), (null), (null), (null), resize grow) +cfg_mode_binding(bindcode, Mod1, 44, (null), (null), (null), (null), resize shrink) +cfg_mode_binding(bindsym, Mod1, x, --release, (null), (null), (null), exec foo) +cfg_mode_binding(bindsym, (null), button3, (null), (null), --whole-window, (null), nop) +cfg_mode_binding(bindsym, (null), button3, --release, (null), --whole-window, (null), nop) +cfg_mode_binding(bindsym, (null), button3, (null), --border, (null), (null), nop) +cfg_mode_binding(bindsym, (null), button3, --release, --border, (null), (null), nop) +cfg_mode_binding(bindsym, (null), button3, (null), (null), (null), --exclude-titlebar, nop) +cfg_mode_binding(bindsym, (null), button3, (null), --border, --whole-window, --exclude-titlebar, nop) EOT is(parser_calls($config), @@ -112,6 +116,7 @@ is(parser_calls($config), $config = <<'EOT'; assign [class="^Chrome"] 4 +assign [class="^Chrome"] workspace number 3 assign [class="^Chrome"] named workspace assign [class="^Chrome"] "quoted named workspace" assign [class="^Chrome"] → "quoted named workspace" @@ -119,13 +124,15 @@ EOT $expected = <<'EOT'; cfg_criteria_add(class, ^Chrome) -cfg_assign(4) +cfg_assign(4, 0) cfg_criteria_add(class, ^Chrome) -cfg_assign(named workspace) +cfg_assign(3, 1) cfg_criteria_add(class, ^Chrome) -cfg_assign(quoted named workspace) +cfg_assign(named workspace, 0) cfg_criteria_add(class, ^Chrome) -cfg_assign(quoted named workspace) +cfg_assign(quoted named workspace, 0) +cfg_criteria_add(class, ^Chrome) +cfg_assign(quoted named workspace, 0) EOT is(parser_calls($config), @@ -286,6 +293,7 @@ hide_edge_borders none hide_edge_borders vertical hide_edge_borders horizontal hide_edge_borders both +hide_edge_borders smart EOT $expected = <<'EOT'; @@ -293,6 +301,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), @@ -369,40 +378,6 @@ is(parser_calls($config), $expected, 'force_display_urgency_hint ok'); -################################################################################ -# delay_exit_on_zero_displays -################################################################################ - -is(parser_calls('delay_exit_on_zero_displays 300'), - "cfg_delay_exit_on_zero_displays(300)\n", - 'delay_exit_on_zero_displays ok'); - -is(parser_calls('delay_exit_on_zero_displays 500 ms'), - "cfg_delay_exit_on_zero_displays(500)\n", - 'delay_exit_on_zero_displays ok'); - -is(parser_calls('delay_exit_on_zero_displays 700ms'), - "cfg_delay_exit_on_zero_displays(700)\n", - 'delay_exit_on_zero_displays ok'); - -$config = <<'EOT'; -delay_exit_on_zero_displays 300 -delay_exit_on_zero_displays 500 ms -delay_exit_on_zero_displays 700ms -delay_exit_on_zero_displays 700 -EOT - -$expected = <<'EOT'; -cfg_delay_exit_on_zero_displays(300) -cfg_delay_exit_on_zero_displays(500) -cfg_delay_exit_on_zero_displays(700) -cfg_delay_exit_on_zero_displays(700) -EOT - -is(parser_calls($config), - $expected, - 'delay_exit_on_zero_displays ok'); - ################################################################################ # workspace ################################################################################ @@ -446,19 +421,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.placeholder, #000000, #0c0c0c, #ffffff, #000000) +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), @@ -474,16 +449,59 @@ hide_edge_border both 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', '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', 'delay_exit_on_zero_displays', '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_all_tokens = "ERROR: CONFIG: Expected one of these tokens: , '#', '" . join("', '", 'set ', 'set ', qw( + 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 + disable_randr15 + disable-randr15 + 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 + )) . "'\n"; my $expected_end = <<'EOT'; 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; @@ -498,12 +516,12 @@ 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), @@ -661,8 +679,8 @@ mode "yo" { EOT $expected = <<'EOT'; -cfg_enter_mode(yo) -cfg_mode_binding(bindsym, (null), x, (null), (null), (null), resize shrink left) +cfg_enter_mode((null), yo) +cfg_mode_binding(bindsym, (null), x, (null), (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" { @@ -690,7 +708,7 @@ 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', 'hidden_state', 'id', 'modifier', 'wheel_up_cmd', 'wheel_down_cmd', 'bindsym', 'position', 'output', 'tray_output', 'font', 'separator_symbol', 'binding_mode_indicator', 'workspace_buttons', 'strip_workspace_numbers', '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