Skip to content

Add helper tests for gorm.go#7661

Open
miladev95 wants to merge 1 commit intogo-gorm:masterfrom
miladev95:test/gorm-helpers
Open

Add helper tests for gorm.go#7661
miladev95 wants to merge 1 commit intogo-gorm:masterfrom
miladev95:test/gorm-helpers

Conversation

@miladev95
Copy link
Copy Markdown
Contributor

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Introduces gorm_simple_test.go with focused tests for Set/Get, InstanceSet/InstanceGet, error chaining (AddError), clone behavior in getInstance, context handling (WithContext), Expr helper, and ToSQL invocation using a noop dialector to keep execution lightweight.

@propel-code-bot
Copy link
Copy Markdown
Contributor

Add lightweight helper tests for gorm.go helpers

Adds one new file gorm_simple_test.go containing a suite of focused unit-tests that exercise helper functionality in gorm.go without touching production code. A minimal in-memory noopDialector stub is introduced to avoid real DB interaction, keeping tests fast and isolated.

Key Changes

• Created gorm_simple_test.go (+159 LOC) with seven test functions covering Set/Get, InstanceSet/InstanceGet, AddError chaining, getInstance cloning paths (clone==0/1/2), WithContext, ToSQL, and Expr helper correctness
• Implemented lightweight noopDialector type inside the test file to satisfy the Dialector interface for unit testing

Affected Areas

gorm_simple_test.go (new tests only)

This summary was automatically generated by @propel-code-bot

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