Cripts: make URL::Query copyable via deep-copy of _state#13269
Open
serrislew wants to merge 4 commits into
Open
Cripts: make URL::Query copyable via deep-copy of _state#13269serrislew wants to merge 4 commits into
serrislew wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes cripts::Url::Query copyable by explicitly defining copy ctor/copy-assign to deep-copy the internal std::unique_ptr<State> scratch space, and re-enables move operations that would otherwise be suppressed. It adds coverage in Cripts gold tests and updates a Cripts test snippet to exercise the new copy operations.
Changes:
- Add explicit
cripts::Url::Querycopy ctor / copy-assign (deep-copy_state) and default move operations. - Add a new Cripts gold-test plugin and test run validating copy + mutation behavior of
Url::Query. - Update an existing Cripts test snippet to use the new copy ctor.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| include/cripts/Urls.hpp | Implements explicit copy/move operations for Url::Query by deep-copying _state. |
| src/cripts/tests/query_test.cc | Exercises Url::Query copy construction and logs before/after mutation. |
| tests/gold_tests/cripts/files/query_copy.cript | New Cripts plugin used by gold tests to validate copy/copy-assign behavior. |
| tests/gold_tests/cripts/cripts.test.py | Adds an origin transaction, remap, and a new curl-based gold test run for query copy behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Url::Queryholds its parsed-parameter scratch space in astd::unique_ptr<State>, which implicitly deletes the copy ctor and copy-assign. This PR defines the copy operations explicitly to deep-copy*_state, and= defaults the moves so they aren't suppressed by the user-declared copies.