From 51119c75c16f86d06b0dde079c8fadd5a7f521ae Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 4 Aug 2011 20:11:01 +0200 Subject: [PATCH] extend t/65-for_window to check for the 'instance' criterion --- testcases/t/65-for_window.t | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/testcases/t/65-for_window.t b/testcases/t/65-for_window.t index f156f11b..2fb85dfa 100644 --- a/testcases/t/65-for_window.t +++ b/testcases/t/65-for_window.t @@ -244,6 +244,73 @@ cmp_ok(@content, '==', 1, 'one node on this workspace now'); is($content[0]->{border}, 'normal', 'no border'); +exit_gracefully($process->pid); + +############################################################## +# 5: check that a class criterion does not match the instance +############################################################## + +$config = <root->create_child( + class => WINDOW_CLASS_INPUT_OUTPUT, + rect => [ 0, 0, 30, 30 ], + background_color => '#00ff00', +); + +$window->_create; + +set_wm_class($window->id, 'bar', 'foo'); +$window->name('usethis'); +$window->map; +sleep 0.25; + +@content = @{get_ws_content($tmp)}; +cmp_ok(@content, '==', 1, 'one node on this workspace now'); +is($content[0]->{border}, 'normal', 'normal border, not matched'); + +exit_gracefully($process->pid); + +############################################################## +# 6: check that the 'instance' criterion works +############################################################## + +$config = <root->create_child( + class => WINDOW_CLASS_INPUT_OUTPUT, + rect => [ 0, 0, 30, 30 ], + background_color => '#00ff00', +); + +$window->_create; + +set_wm_class($window->id, 'bar', 'foo'); +$window->name('usethis'); +$window->map; +sleep 0.25; + +@content = @{get_ws_content($tmp)}; +cmp_ok(@content, '==', 1, 'one node on this workspace now'); +is($content[0]->{border}, 'none', 'no border'); + exit_gracefully($process->pid); done_testing; -- 2.39.5