logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Cucumber::TagExpressions::Node - Cucumber Tag expression components

Description

       This module defines the components making up the tag expressions.

License

       Please see the included LICENSE for the canonical version. In summary:

       The MIT License (MIT)

         Copyright (c) 2021 Erik Huelsmann
         Copyright (c) 2021 Cucumber Ltd

       This work is loosely derived from prior work of the same library for Ruby, called "cucumber-messages".

perl v5.38.2                                       2024-01-13                Cucumber::TagExpressions::Node(3pm)

Methods

evaluate(@tags)
       Returns "true" when the tag set specified in $tags satisfies the condition(s) of the expression, "false"
       otherwise.

       @tags can be a list of tags to be used in the expression. It can also be a reference to a hash with the
       keys being the tags and the values being considered boolean values indicating whether the tag (key) is
       considered part of the tagset (true) or not (false).

   stringify
       Returns a string representation of the expression node.

Name

       Cucumber::TagExpressions::Node - Cucumber Tag expression components

Node Classes

Cucumber::TagExpressions::LiteralNodeDESCRIPTION

       This node class returns "true" if the literal tag is specified as part of the tag-list in the expression
       evaluation.

       ATTRIBUTES

       tag

       The tag to test presence for.

   Cucumber::TagExpressions::AndNodeDESCRIPTION

       This node class type evaluates one or more sub-expressions ("terms") and returns "false" if any of the
       terms does. It returns "true" if all of the terms return "true".

       ATTRIBUTES

       terms

       The sub-expressions to evaluate.

   Cucumber::TagExpressions::OrNodeDESCRIPTION

       This node class type evaluates one or more sub-expressions ("terms") and returns "true" if any of the
       terms does. It returns "false" if all of the terms return "false".

       ATTRIBUTES

       terms

       The sub-expressions to evaluate.

   Cucumber::TagExpressions::NotNodeDESCRIPTION

       This class wraps one of the other node class types, negating its result on evaluation.

       ATTRIBUTES

       expression

       The wrapped node class instance for which to negate the result.

   Cucumber::TagExpressions::ExpressionNodeDESCRIPTION

       This class models the outer-most node in the tag expression; it wraps all other nodes and is the entry-
       point for tag expression evaluation.

       ATTRIBUTES

       sub_expression

       An instance of one of the other node class types.

Synopsis

         use Cucumber::TagExpressions;

         my $expr = Cucumber::TagExpressions->parse( '@a and @b' );
         if ( $expr->evaluate( qw/x y z/ ) ) {
            say "The evaluation returned false";
         }

See Also