Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHORE add unittest test function ConvertMapToValueForCreate #6846

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

naruchet
Copy link
Contributor

Adds unit tests for ConvertMapToValuesForCreate function in GORM, ensuring correct value conversion from maps to database columns for CREATE operations.

@a631807682
Copy link
Member

This test and the original visit_map_test.go can be moved to helper_test.go

@naruchet
Copy link
Contributor Author

This test and the original visit_map_test.go can be moved to helper_test.go

@a631807682
Hi

The function loadOrStoreVisitMap in the callbacks package is a private function. This means that it can only be accessed and used by code within the same package.

If you move the unit test for this function from visite_map_test.go to helper_test.go, the unit test will no longer be able to access the function because it will be in a different package.

do you want to move only convert_map_test.go first

@a631807682
Copy link
Member

This test and the original visit_map_test.go can be moved to helper_test.go

@a631807682 Hi

The function loadOrStoreVisitMap in the callbacks package is a private function. This means that it can only be accessed and used by code within the same package.

If you move the unit test for this function from visite_map_test.go to helper_test.go, the unit test will no longer be able to access the function because it will be in a different package.

do you want to move only convert_map_test.go first

Sorry, I didn't make it clear, I meant move to callbacks/helper_test.go .

…d visit_map_test.go into the file helper_test.go.
@naruchet
Copy link
Contributor Author

This test and the original visit_map_test.go can be moved to helper_test.go

@a631807682 Hi
The function loadOrStoreVisitMap in the callbacks package is a private function. This means that it can only be accessed and used by code within the same package.
If you move the unit test for this function from visite_map_test.go to helper_test.go, the unit test will no longer be able to access the function because it will be in a different package.
do you want to move only convert_map_test.go first

Sorry, I didn't make it clear, I meant move to callbacks/helper_test.go .

@a631807682
Hi. i already move the test cases located in the files convert_map_test.go and visit_map_test.go into the file helper_test.go.

@jinzhu jinzhu merged commit 52404cd into go-gorm:master Feb 27, 2024
34 checks passed
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.

4 participants