Skip to content

Add unit tests for MessageData and DebugMessageTree in utility_types.rs#4049

Open
yuvraj-kolkar17 wants to merge 3 commits intoGraphiteEditor:masterfrom
yuvraj-kolkar17:test-utility-types
Open

Add unit tests for MessageData and DebugMessageTree in utility_types.rs#4049
yuvraj-kolkar17 wants to merge 3 commits intoGraphiteEditor:masterfrom
yuvraj-kolkar17:test-utility-types

Conversation

@yuvraj-kolkar17
Copy link
Copy Markdown

@yuvraj-kolkar17 yuvraj-kolkar17 commented Apr 24, 2026

Summary

Added unit tests for the MessageData and DebugMessageTree structs in editor/src/utility_types.rs.

Part of #3936

Changes

  • Added #[cfg(test)] test module in editor/src/utility_types.rs
  • 39 new unit tests covering all public methods of MessageData and DebugMessageTree

Test Results

How to Verify

cargo test utility_types

AI Assistance
Claude Sonnet 4.6
Some parts of the unit tests were written with the help of AI tool.

  • All code was reviewed, verified, and tested manually.

Signed-off-by: Yuvraj Kolkar <kolkaryuvraj2@gmail.com>
@yuvraj-kolkar17 yuvraj-kolkar17 changed the title test(): Add Unit Tests for editor/src/utility_types.rs Add unit tests for MessageData and DebugMessageTree in utility_types.rs Apr 24, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive unit test suite for the MessageData and DebugMessageTree structures in editor/src/utility_types.rs. The tests cover object instantiation, field updates, and nested variant handling. Feedback was provided to rename a misleading test case and to strengthen assertions by verifying entire collections rather than individual elements, ensuring better data integrity in the tests.

Comment thread editor/src/utility_types.rs Outdated
Comment thread editor/src/utility_types.rs Outdated
Comment thread editor/src/utility_types.rs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Signed-off-by: Yuvraj Kolkar <kolkaryuvraj2@gmail.com>
@yuvraj-kolkar17
Copy link
Copy Markdown
Author

PTAL @TrueDoctor @Keavon

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