Skip to content

fix(tests): fix variable shadowing, untested invalid inputs, and array length mismatch in c32encoding tests#47

Open
jadonamite wants to merge 1 commit intostacks-network:masterfrom
jadonamite:patch-1
Open

fix(tests): fix variable shadowing, untested invalid inputs, and array length mismatch in c32encoding tests#47
jadonamite wants to merge 1 commit intostacks-network:masterfrom
jadonamite:patch-1

Conversation

@jadonamite
Copy link

What does this PR do?

Fixes three bugs in the c32encoding test suite and adds inline comments for maintainability.

Changes

  • Fix variable shadowing: renamed .map() callback parameter from testData to entry in c32encodingRandomBytes to avoid shadowing the outer array
  • Fix silently skipped assertions: split grouped try/catch blocks in c32checkEncode invalid inputs into individual blocks so every invalid case is independently tested
  • Fix array length mismatch: removed extra trailing undefined from hexMinLengths (had 23 elements for 22 hex strings)

Testing

All existing tests pass. No new tests added — fixes ensure existing invalid input tests actually run as intended.

Refactor tests to improve clarity and fix variable shadowing issues. Update comments and ensure all invalid inputs are independently tested.
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