test: cover nextSubtreeSize - #335
Conversation
Signed-off-by: Vladislav Lapin <v.lapin@scalablesolutions.io>
rach-id
left a comment
There was a problem hiding this comment.
Use this prompt to include the relevant test cases:
Update PR #335 to strengthen TestNextSubtreeSize in proof_test.go.
The current table only uses power-of-two range lengths, and every positive even start is itself a power of two. Add table cases that exercise:
- Rounding a non-power-of-two remaining span down, such as (start: 0, end: 12) → 8 and (start: 8, end: 14) → 4.
- Alignment for a composite even start, such as (start: 12, end: 20) → 4.
Keep the change test-only unless investigation reveals an actual implementation defect. Use descriptive case names consistent with the existing table.
After editing, run:
go test ./...
go vet ./...
git diff --checkReview the final diff to ensure the new cases independently constrain both behaviors implemented by nextSubtreeSize: start alignment and rounding based on the remaining range.
|
Addressed the requested coverage in a0841be: added independent cases for non-power-of-two remaining spans at |
Closes #265
Summary
Testing