Skip to content

Refactor tests and update comments#678

Merged
fxamacker merged 4 commits intomasterfrom
fxamacker/refactor-tests-and-fix-spelling-in-comments
Jun 30, 2025
Merged

Refactor tests and update comments#678
fxamacker merged 4 commits intomasterfrom
fxamacker/refactor-tests-and-fix-spelling-in-comments

Conversation

@fxamacker
Copy link
Owner

This PR refactors tests:

  • Replace positional field initialization in test cases with named field initialization (to improve readability).

  • Remove commented out tests.

  • Modernize by using fmt.Appendf.

  • Rename two test funcs that can panic:

    • hexDecode() -> mustHexDecode()
    • bigIntOrPanic() -> mustBigInt()
  • Update comments to use one "l" in "marshal*", such as "marshalling" -> "marshaling" (to use same spelling as Go).

NOTE: Some non-test files were also updated but those are limited to spelling change in comments.

This commit replaces positional field initialization in test cases
with named field initialization to improve readability.

While at it, also remove tests that were commented out.
This commit renames two test funcs to begin with "must"
if they can panic:
- hexDecode() -> mustHexDecode()
- bigIntOrPanic() -> mustBigInt()
This commit updates the spelling of words containing "marshal"
to use just one "l" instead of "ll".  For example:
- marshalling -> marshaling
- marshalled -> marshaled
- etc.

This spelling change follows the convention used by Go.
@fxamacker fxamacker self-assigned this Jun 30, 2025
@fxamacker fxamacker added the improvement improvement that does not add new feature label Jun 30, 2025
@fxamacker
Copy link
Owner Author

@x448 PTAL 🙏 There were no coding changes to non-test files.

@fxamacker fxamacker merged commit 2d79f19 into master Jun 30, 2025
22 checks passed
@fxamacker fxamacker added this to the v2.9.0 milestone Jul 5, 2025
@fxamacker fxamacker deleted the fxamacker/refactor-tests-and-fix-spelling-in-comments branch September 16, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement improvement that does not add new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants