Copilot commented on code in PR #13269:
URL: https://github.com/apache/trafficserver/pull/13269#discussion_r3422886721
##########
tests/gold_tests/cripts/cripts.test.py:
##########
@@ -91,8 +106,25 @@ def runCertsTest(self):
tr.Processes.Default.Streams.stderr = "gold/certs_cript.gold"
tr.StillRunningAfter = self.server
+ def runQueryCopyTest(self):
+ tr = Test.AddTestRun('Exercise Query copy ctor / copy-assign in
cripts.')
+ tr.MakeCurlCommand(
+ f'-v -H "Host: query.example.com"
"http://127.0.0.1:{self.ts.Variables.port}/query?foo=1&bar=2&baz=3"',
ts=self.ts)
+ tr.Processes.Default.ReturnCode = 0
+ # Live URL is untouched: original query is preserved.
+ tr.Processes.Default.Streams.stderr += Testers.ContainsExpression(
+ r"X-Original-Query: foo=1&bar=2&baz=3", "Original query must
round-trip unchanged")
+ # Mutating the copy (Erase "foo") must not have leaked into the
original.
+ tr.Processes.Default.Streams.stderr += Testers.ContainsExpression(
+ r"X-Copy-Query: bar=2&baz=3", "Erase on the copy must drop foo
without affecting the original")
+ # Copy-assignment path produces a snapshot equal to the original.
+ tr.Processes.Default.Streams.stderr += Testers.ContainsExpression(
+ r"X-Assigned-Query: foo=1&bar=2&baz=3", "Copy-assigned query must
equal the original")
Review Comment:
`tr.Processes.Default.Streams.stderr` is only appended-to with `+=` here,
but this run never initializes `Streams.stderr` (e.g., to a gold file or an
initial tester). In AuTest patterns elsewhere, `+=` is used only after an
initial assignment; leaving it unset can be a no-op or raise depending on the
underlying `Streams` implementation. Initialize `Streams.stderr` with the first
`ContainsExpression` and then append the rest.
##########
include/cripts/Urls.hpp:
##########
@@ -485,6 +485,24 @@ class Url
_state->standalone = true;
}
+ // Query owns a std::unique_ptr<State>, which makes the implicit copy
operations
+ // deleted
Review Comment:
The new comment reads awkwardly ("makes the implicit copy operations
deleted") and is missing terminal punctuation; tightening it improves
readability.
--
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]