Variable substitution in expression string literals

Hi Chris,

One small nit with string comparisons in XML.

This statement was not working for me (was never true even when the string
value was in fact “ready”).

<action type="assert" condition='"$var" == "ready"'/>

When I changed it to this, it worked:

<action type="assert" condition='"$var x" == "ready x"'/>

I assume this had something to do with $expression parsing. I last tested
it on a nightly a few months ago, so I’m not sure if you fixed it in your
recent changes. But it’s probably worth a testcase.

-Mark

Hi Mark,

My expectation is that neither of your examples would work. $var substitution in the message parameters of report, assert, and wait_for_condition is implemented as a special case that’s private to those actions. It isn’t supposed to work generally, so I’d call the success of the second example a bug. I need to figure out what’s happening there.

Anyway, it doesn’t really matter, because here’s how you should write this assertion:

<action type="assert" condition='var == "ready"'/>

The fact that you tried to use "$var" makes me think you’ve been doing too much shell scripting lately :wink:

Chris