Skip to content

Add unit tests for shared reference instance serialization - #86

Merged
sator-imaging merged 3 commits into
mainfrom
test/duplicate-instance-serialization-6741374473968267597
Aug 20, 2026
Merged

Add unit tests for shared reference instance serialization#86
sator-imaging merged 3 commits into
mainfrom
test/duplicate-instance-serialization-6741374473968267597

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

Adds models and unit tests to verify that reference-type instances shared across multiple properties on a serializable object can be serialized and read via generated view structs.


PR created automatically by Jules for task 6741374473968267597 started by @sator-imaging

Added DuplicateInstanceContainer, SharedClassItem, and SharedClassNested
models along with a SharedReferenceInstancesRoundTrip unit test to verify
serialization and view reading for shared reference type instances.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Comment thread tests/SerializationTests.cs Outdated
Comment on lines +1239 to +1241
Foo = sharedItem,
Bar = sharedItem,
Baz = sharedItem,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expect more complex test condition.

  • Foo and Bar share instance.
  • Baz donesn't share, but shares SharedClassNested instance with Foo and Bar.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the test condition to cover both cases: where all properties (Foo, Bar, Baz) share the exact same instance, and where Foo and Bar share an instance while Baz is a distinct instance that shares the nested SharedClassNested instance.

Updated SharedReferenceInstancesRoundTrip to verify both complete instance
sharing across Foo, Bar, and Baz, as well as complex graph sharing where Foo and Bar
share an instance while Baz is a distinct item sharing a nested instance.
Comment thread tests/SerializationTests.cs Outdated
Removed simple duplicate instance test case and retained complex sharing
case where Foo and Bar share a SharedClassItem instance while Baz has a
distinct SharedClassItem instance sharing the same nested SharedClassNested instance.
@sator-imaging
sator-imaging marked this pull request as ready for review August 20, 2026 21:46
@sator-imaging
sator-imaging merged commit 75b7e6b into main Aug 20, 2026
4 checks passed
@sator-imaging
sator-imaging deleted the test/duplicate-instance-serialization-6741374473968267597 branch August 20, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant