From 09d1deda7f471c737d38665c4f6a212429ee5b37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Sun, 19 Apr 2015 10:47:09 +0200 Subject: [PATCH] Small cleanups: * Implement criterion specs just like it is done in the spec for the config * Declare variables in test case early so the 'my' keyword can be dropped in the actual test cases --- parser-specs/commands.spec | 14 +++++++------- testcases/t/232-cmd-move-criteria.t | 12 +++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec index e6217b19..d8f81d3e 100644 --- a/parser-specs/commands.spec +++ b/parser-specs/commands.spec @@ -41,15 +41,15 @@ state INITIAL: 'bar' -> BAR state CRITERIA: - ctype = 'class' -> CRITERION - ctype = 'instance' -> CRITERION + ctype = 'class' -> CRITERION + ctype = 'instance' -> CRITERION ctype = 'window_role' -> CRITERION - ctype = 'con_id' -> CRITERION - ctype = 'id' -> CRITERION - ctype = 'con_mark' -> CRITERION - ctype = 'title' -> CRITERION - ctype = 'urgent' -> CRITERION + ctype = 'con_id' -> CRITERION + ctype = 'id' -> CRITERION ctype = 'window_type' -> CRITERION + ctype = 'con_mark' -> CRITERION + ctype = 'title' -> CRITERION + ctype = 'urgent' -> CRITERION ']' -> call cmd_criteria_match_windows(); INITIAL state CRITERION: diff --git a/testcases/t/232-cmd-move-criteria.t b/testcases/t/232-cmd-move-criteria.t index 48a51d56..c023bca4 100644 --- a/testcases/t/232-cmd-move-criteria.t +++ b/testcases/t/232-cmd-move-criteria.t @@ -18,21 +18,23 @@ # Bug still in: 4.8-16-g6888a1f use i3test; +my ($ws, $win1, $win2, $win3, $ws_con); + ############################################################################### # Tets moving with 'id' criterion. ############################################################################### -my $ws = fresh_workspace; +$ws = fresh_workspace; -my $win1 = open_window; -my $win2 = open_window; -my $win3 = open_window; +$win1 = open_window; +$win2 = open_window; +$win3 = open_window; # move win1 from the left to the right cmd '[id="' . $win1->{id} . '"] move right'; # now they should be switched, with win2 still being focused -my $ws_con = get_ws($ws); +$ws_con = get_ws($ws); # win2 should be on the left is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with criteria'); -- 2.39.2