Skip to content

test(errors/gcode,gerror): add unit tests for error handling interfaces and methods#4586

Merged
houseme merged 3 commits intomasterfrom
fix/errors_ut
Jan 5, 2026
Merged

test(errors/gcode,gerror): add unit tests for error handling interfaces and methods#4586
houseme merged 3 commits intomasterfrom
fix/errors_ut

Conversation

@hailaz
Copy link
Contributor

@hailaz hailaz commented Jan 4, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 4, 2026 09:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive unit tests for error handling interfaces and methods in the errors/gerror and errors/gcode packages. The tests verify the behavior of various error interfaces (ICause, IStack, ICurrent, IUnwrap, IEqual, ICode) and related error manipulation functions.

  • Adds custom error types implementing various gerror interfaces to enable thorough testing
  • Tests edge cases and interface implementations for error handling functions
  • Adds tests for the String() method in gcode package

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
errors/gerror/gerror_z_unit_test.go Adds 6 custom error types implementing different error interfaces and 12 new test functions covering Code(), Cause(), Stack(), Current(), Equal(), formatting, and multi-text parameter scenarios
errors/gcode/gcode_z_unit_test.go Adds Test_String() function to verify the String() method behavior with different combinations of message and detail fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hailaz hailaz requested a review from houseme January 5, 2026 03:33
@houseme houseme merged commit d148e0e into master Jan 5, 2026
32 checks passed
@houseme houseme deleted the fix/errors_ut branch January 5, 2026 05:26
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.

3 participants