You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "cmcfarlen (via GitHub)" <gi...@apache.org> on 2026/10/02 19:05:12 UTC

Re: [PR] hrw4u: remove the bare operator statement that never compiled [trafficserver]

cmcfarlen commented on code in PR #13705:
URL: https://github.com/apache/trafficserver/pull/13705#discussion_r4168917552


##########
tools/hrw4u/tests/test_ast_visitor.py:
##########
@@ -80,12 +80,12 @@ def test_with_args(self):
         assert fc.name == "set-header"
         assert fc.args == (LiteralStringValue(raw="X-Foo"), LiteralStringValue(raw="bar"))
 
-    def test_standalone_operator(self):
-        ast = _build('REMAP {\n    skip-remap;\n}')
+    def test_bool_arg(self):
+        ast = _build('REMAP {\n    skip-remap(true);\n}')
         fc = ast.body[0].body[0]
         assert isinstance(fc, FunctionCall)
         assert fc.name == "skip-remap"
-        assert fc.args == ()
+        assert fc.args == (True,)

Review Comment:
   #13699 (2651038e6f) changed `ASTVisitor._extract_value` to return `BoolValue(raw="true")` for `true`/`false` arguments, so on master `skip-remap(true)` parses to `(BoolValue(raw="true"),)` and this assertion fails. CI passes only because the PR's merge base is from before #13699. After rebasing this should be:
   
   ```python
   assert fc.args == (BoolValue(raw="true"),)
   ```
   
   which matches the other bool assertions in this file on master.



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org