Skip to content

✅ test: Document Hex.slice() handles negative indices#269

Merged
roninjin10 merged 1 commit intomainfrom
fix/issue-105-hex-slice
Jan 4, 2026
Merged

✅ test: Document Hex.slice() handles negative indices#269
roninjin10 merged 1 commit intomainfrom
fix/issue-105-hex-slice

Conversation

@roninjin10
Copy link
Contributor

Summary

Test plan

  • slice(-N) gets last N bytes
  • slice(0, -N) excludes last N bytes
  • Both negative indices work
  • Edge cases handled

🤖 Generated with Claude Code

Hex.slice() already supports negative indices via Uint8Array.slice(),
but documentation/tests were incomplete. Added tests for:
- slice(-N) to get last N bytes
- slice(0, -N) to exclude last N bytes
- slice(-M, -N) with both negative indices
- Edge case: negative index larger than length

Closes #105

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dist Error Error Jan 4, 2026 9:11am
voltaire Error Error Jan 4, 2026 9:11am

@roninjin10 roninjin10 merged commit e494e59 into main Jan 4, 2026
19 of 48 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.

Bug: Hex.slice() negative indices not handled

1 participant