X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ffddb5c07960091a33cfd6f91b6a3245efdcccf2..1edebcf0aed748b75fa68e46aad70dbeeadfdd85:/t/menu/parse_access_string.t diff --git a/t/menu/parse_access_string.t b/t/menu/parse_access_string.t index f1cbd4289..fd6e790ae 100644 --- a/t/menu/parse_access_string.t +++ b/t/menu/parse_access_string.t @@ -57,6 +57,24 @@ ok(!$menu->parse_access_string(\%node), 'parenthesis 2'); $node{access} = 'sales_quotation_edit & client/feature_experimental'; ok($menu->parse_access_string(\%node), 'client'); +$node{access} = '!no_such_right'; +ok($menu->parse_access_string(\%node), 'simple negation 1'); + +$node{access} = '!sales_order_edit'; +ok(!$menu->parse_access_string(\%node), 'simple negation 2'); + +$node{access} = '!!sales_order_edit'; +ok($menu->parse_access_string(\%node), 'double negation'); + +$node{access} = '(no_such_right & sales_order_edit | !(no_such_right & sales_order_edit))'; +ok($menu->parse_access_string(\%node), 'parenthesis with negation 1'); + +$node{access} = '(no_such_right & sales_order_edit | (!no_such_right | !sales_order_edit))'; +ok($menu->parse_access_string(\%node), 'parenthesis with negation 2'); + +$node{access} = 'sales_quotation_edit & !client/feature_experimental'; +ok(!$menu->parse_access_string(\%node), 'client negation'); + done_testing; 1;