Updates:
Summary: Executing `Run Keyword` variants in dry-run mode can fail if keyword name contains variable
        Status: Started
        Owner: pekka.klarck

Comment #2 on issue 1670 by pekka.klarck: Executing `Run Keyword` variants in dry-run mode can fail if keyword name contains variable
http://code.google.com/p/robotframework/issues/detail?id=1670

After little investigation I figured out what goes wrong here.

Background: Robot runs `Run Keyword` variants also in dry-run mode if the keyword they execute is defined as-is without using variables. This is because resolving variables doesn't work in dry-run mode in general. Only some of the variables actually have a value in dry-run and even they may have wrong values.

The bug: The check to test does given keyword name contain variables is buggy. It fails if the variable name and its value are same even if the name would contain a variable. This can be demonstrated with the following simple example:

*** Variables ***
${name}    No Operation

*** Test Cases ***
Works
    Higher order fun    No Operation

Fails when argument name and value are same
    Higher order fun    ${name}

*** Keywords ***
Higher order fun
    [Arguments]    ${name}
    Run Keyword    ${name}

In the original example ${HIGHER_ORDER_FUN} variable ends up having value ${HIGHER_ORDER_FUN} inside keyword Second and thus it fails for the same reason. I don't know exactly why that variable gets that value, but it shouldn't be relevant for this bug.

The fix: The check does a keyword name contain variable just needs to be fixed. Luckily we have a pretty new utility function for that exact usage so the fix is very easy.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to