Copilot commented on code in PR #375:
URL: https://github.com/apache/commons-scxml/pull/375#discussion_r2576547173
##########
src/test/java/org/apache/commons/scxml2/env/jexl/wildcard-01.xml:
##########
@@ -22,15 +22,19 @@
initial="state1">
<state id="state1">
<onentry>
- <cs:var name="switch" expr="4" />
+ <!-- since JEXL 3.6, 'switch' is a keyword, so we use 'swtch'
instead -->
+ <cs:var name="swtch" expr="4" />
</onentry>
<!-- We'll trigger 'foo.bar.baz' event,
and therefore, must end up in state4 -->
- <transition event="*" cond="switch eq 2" target="state2"/>
- <transition event="foo.*" cond="switch eq 3" target="state3"/>
- <transition event="foo.bar.*" cond="switch eq 4" target="state4"/>
+ <transition event="*" cond="swtch eq 2" target="state2"/>
+ <transition event="foo.*" cond="swtch eq 3" target="state3"/>
+ <transition event="foo.bar.*" cond="swtch eq 4" target="state4"/>
+ <!-- If something goes wrong, ensure we end up in the error state
and not loop forever -->
+ <transition event="error.execution" target="error" />
</state>
<final id="state2"/>
<final id="state3"/>
<final id="state4"/>
+ <final id="error"/>
Review Comment:
The addition of error handling (`error.execution` transition and error
state) changes the test's behavior. If using 'switch' as a keyword causes an
execution error in JEXL 3.6.0, the test would now silently pass by
transitioning to the error state instead of failing. This masks whether the
'swtch' rename actually resolved the keyword conflict.
Consider removing these error handling additions (lines 33-34 and 39) to
ensure the test still validates the intended wildcard matching behavior, and
would fail if there were any issues with the variable name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]