X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=blobdiff_plain;f=testcases%2Ft%2F253-multiple-net-wm-state-atoms.t;fp=testcases%2Ft%2F253-multiple-net-wm-state-atoms.t;h=3a3e7c6e8bcf8a87b7686c3c43586bbba2aa839a;hp=3790f92ddfee6ac5f98cb5b1f24235e7aaa83ec1;hb=1847938d4eeba98260cc79ca45a11a134274c2ea;hpb=c54f5008395b10c046f380cc3069ff779e5d2877 diff --git a/testcases/t/253-multiple-net-wm-state-atoms.t b/testcases/t/253-multiple-net-wm-state-atoms.t index 3790f92d..3a3e7c6e 100644 --- a/testcases/t/253-multiple-net-wm-state-atoms.t +++ b/testcases/t/253-multiple-net-wm-state-atoms.t @@ -21,22 +21,22 @@ use X11::XCB qw(:all); sub get_wm_state { sync_with_i3; - my ($con) = @_; + my ($con) = @_; my $cookie = $x->get_property( - 0, + 0, $con->{id}, $x->atom(name => '_NET_WM_STATE')->id, GET_PROPERTY_TYPE_ANY, - 0, + 0, 4096 - ); + ); my $reply = $x->get_property_reply($cookie->{sequence}); my $len = $reply->{length}; return undef if $len == 0; my @atoms = unpack("L$len", $reply->{value}); - return \@atoms; + return @atoms; } my $wm_state_sticky = $x->atom(name => '_NET_WM_STATE_STICKY')->id; @@ -51,18 +51,24 @@ my $wm_state_fullscreen = $x->atom(name => '_NET_WM_STATE_FULLSCREEN')->id; fresh_workspace; my $window = open_window; cmd 'sticky enable'; -is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'sanity check: _NET_WM_STATE_STICKY is set'); +my @state = get_wm_state($window); +ok((scalar grep { $_ == $wm_state_sticky } @state) > 0, 'sanity check: _NET_WM_STATE_STICKY is set'); cmd 'fullscreen enable'; -is_deeply(get_wm_state($window), [ $wm_state_sticky, $wm_state_fullscreen ], - 'both _NET_WM_STATE_FULLSCREEN and _NET_WM_STATE_STICKY are set'); +@state = get_wm_state($window); +ok((scalar grep { $_ == $wm_state_sticky } @state) > 0, '_NET_WM_STATE_STICKY is set'); +ok((scalar grep { $_ == $wm_state_fullscreen } @state) > 0, '_NET_WM_STATE_FULLSCREEN is set'); cmd 'sticky disable'; -is_deeply(get_wm_state($window), [ $wm_state_fullscreen ], 'only _NET_WM_STATE_FULLSCREEN is set'); +@state = get_wm_state($window); +ok((scalar grep { $_ == $wm_state_sticky } @state) == 0, '_NET_WM_STATE_STICKY is not set'); +ok((scalar grep { $_ == $wm_state_fullscreen } @state) > 0, '_NET_WM_STATE_FULLSCREEN is set'); cmd 'sticky enable'; cmd 'fullscreen disable'; -is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'only _NET_WM_STATE_STICKY is set'); +@state = get_wm_state($window); +ok((scalar grep { $_ == $wm_state_sticky } @state) > 0, '_NET_WM_STATE_STICKY is set'); +ok((scalar grep { $_ == $wm_state_fullscreen } @state) == 0, '_NET_WM_STATE_FULLSCREEN is not set'); ############################################################################### # _NET_WM_STATE is removed when the window is withdrawn. @@ -71,7 +77,8 @@ is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'only _NET_WM_STATE_STICK fresh_workspace; $window = open_window; cmd 'sticky enable'; -is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'sanity check: _NET_WM_STATE_STICKY is set'); +@state = get_wm_state($window); +ok((scalar grep { $_ == $wm_state_sticky } @state) > 0, '_NET_WM_STATE_STICKY is set'); $window->unmap; wait_for_unmap($window);