From d82698efa7ffa11739fc524dc36e84c357691940 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 11 Sep 2011 22:01:36 +0100 Subject: [PATCH] =?utf8?q?make=20the=20old=20assign=20syntax=20trigger=20a?= =?utf8?q?n=20i3-nagbar=20warning=20(it=E2=80=99s=20deprecated),=20adjust?= =?utf8?q?=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cfgparse.y | 9 +++++++-- testcases/t/66-assign.t | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cfgparse.y b/src/cfgparse.y index 53d23815..572fe6d2 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -1076,8 +1076,13 @@ workspace_name: assign: TOKASSIGN window_class STR { - /* TODO: the assign command also needs some kind of new syntax where we - * just use criteria. Then deprecate the old form */ + /* This is the old, deprecated form of assignments. It’s provided for + * compatibility in version (4.1, 4.2, 4.3) and will be removed + * afterwards. It triggers an i3-nagbar warning starting from 4.1. */ + ELOG("You are using the old assign syntax (without criteria). " + "Please see the User's Guide for the new syntax and fix " + "your config file.\n"); + context->has_errors = true; printf("assignment of %s to *%s*\n", $2, $3); char *workspace = $3; char *criteria = $2; diff --git a/testcases/t/66-assign.t b/testcases/t/66-assign.t index 25855b58..b8366917 100644 --- a/testcases/t/66-assign.t +++ b/testcases/t/66-assign.t @@ -240,7 +240,9 @@ $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); my @docked = get_dock_clients; -is(@docked, 0, 'no dock clients yet'); +# We expect i3-nagbar as the first dock client due to using the old assign +# syntax +is(@docked, 1, 'one dock client yet'); my $window = $x->root->create_child( class => WINDOW_CLASS_INPUT_OUTPUT, @@ -259,7 +261,7 @@ my $content = get_ws($tmp); ok(@{$content->{nodes}} == 0, 'no tiling cons'); ok(@{$content->{floating_nodes}} == 0, 'one floating con'); @docked = get_dock_clients; -is(@docked, 1, 'no dock clients yet'); +is(@docked, 2, 'two dock clients now'); $window->destroy; -- 2.39.5