-
Notifications
You must be signed in to change notification settings - Fork 13
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
Avoid using unexported constants in tests #485
Merged
fxamacker
merged 14 commits into
main
from
fxamacker/avoid-using-unexported-consts-in-tests
Jan 30, 2025
Merged
Avoid using unexported constants in tests #485
fxamacker
merged 14 commits into
main
from
fxamacker/avoid-using-unexported-consts-in-tests
Jan 30, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, some tests are using unexported fields of PersistentSlabStorage. This commit improves decoupling: - in storage.go, create unexported functions for those fields - in export_test.go, export those unexported functions in same package, so those exported functions can be used for testing in test package. - modify tests to use the newly exported functions.
This commit avoids using these unexported constants in tests: - minInternalCBORTagNumber - maxInternalCBORTagNumber
This commit avoids using maxInlineArrayElementSize in tests.
This commit avoids using maxInlineMapKeySize in tests.
This commit adds new function MaxInlineMapElementSize() and modifies tests to use the new function instead of unexported constants maxInlineMapElementSize.
This commit: - adds new function targetSlabSize() in settings.go - exports targetSlabSize() to TargetSlabSize() in export_test.go for testing - modifies tests to use exported function instead of unexported constants targetThreshold.
4c4b64c
to
331eea6
Compare
@turbolent Can you review and approve this PR? Other refactor PRs are blocked by this. I'll resolve conflicts after I merge all other refactor PRs to this PR so I only need to resolve conflicts once. |
turbolent
approved these changes
Jan 30, 2025
…rayDataSlab-directly-in-tests Avoid creating ArrayDataSlab directly in tests
…map-fields-in-tests Avoid using unexported `OrderedMap` fields in tests
…Array-root-field-in-tests Avoid using unexported `Array` fields in tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates #464
This PR avoids using these unexported constants in tests:
minInternalCBORTagNumber
maxInternalCBORTagNumber
maxInlineArrayElementSize
maxInlineMapElementSize
maxInlineMapKeySize
targetThreshold
main
branchFiles changed
in the Github PR explorer