Repository navigation
test(linked-list): lock down contract of ReverseSinglyLinkedList (R50-T041) - #89
Open
aniruddha-bongale wants to merge 1 commit into
Open
aniruddha-bongale wants to merge 1 commit into
aniruddha-bongale wants to merge 1 commit into
Conversation
This file contains hidden or 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
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.
Description
This PR addresses task R50-T041 for
ReverseSinglyLinkedList. It documents a concise input/output contract besideReverseSinglyLinkedListand introduces comprehensive contract regression tests covering the stated fixture (A→B→C), smallest supported inputs (nulland single-node), repeated-value domain boundaries, and ordinary multi-element inputs. Node links and values are asserted separately to ensure broken pointer links cannot be masked by value comparisons, and in-place node mutations are explicitly verified.Related Issue
Fixes: #41
Type of Change
Changes Made
ReverseSinglyLinkedList.jsspecifying inputs, results, mutation semantics, and complexity.Data-Structures/Linked-List/test/ReverseSinglyLinkedList.test.js:.nextreferences), node values along links, and observable mutations on original nodes separately.null(empty list) and single-node lists.work/R50-T041/check.pyand saved verifiable execution evidence inwork/R50-T041/results.json.Screenshots / Recordings
N/A (Data structures / algorithmic unit test suite)
Testing
npx prettier --check Data-Structures/Linked-List/ReverseSinglyLinkedList.js Data-Structures/Linked-List/test/ReverseSinglyLinkedList.test.jsnpm test -- Data-Structures/Linked-List/test/ReverseSinglyLinkedList.test.js(6 tests passed)python3 work/R50-T041/check.py(all checks and tool version captures passed)Checklist
Additional Notes
ReverseSinglyLinkedListwhile enforcing contract verification.