Repository navigation
test(graphs): cover failure and empty-result behavior of FloydWarshall (R50-T048) - #96
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
4 tasks
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
Add comprehensive failure-path and empty-result coverage for
FloydWarshallinGraphs/FloydWarshall.js, including unit tests inGraphs/test/FloydWarshall.test.jsexercising the smallest valid input ([[0]]), the empty-result path ([]), disconnected component absent-path sentinels (Infinity), ordinary connected graphs, and sequential caller-state resilience. Automated verification is implemented inwork/R50-T048/check.pysaving execution results towork/R50-T048/results.json.Related Issue
Fixes: #48
Type of Change
Changes Made
FloydWarshallinGraphs/FloydWarshall.jsexplaining the preconditions and execution branches:n = dist.length = 0bypassing loop entry at Line 25 to execute early exit Line 35 (return dist), yielding the valid empty result[].dist[i][j] > dist[i][k] + dist[k][j]evaluates false for disconnected vertices, preserving theInfinitysentinel representing absent shortest paths.Graphs/test/FloydWarshall.test.jscovering:[[0]]).[]).Infinity) for disconnected components.work/R50-T048/check.pyto run native tests, verify assertions on all fixtures with explicit precondition line references, and outputwork/R50-T048/results.json.Screenshots / Recordings
All 6 tests in
Graphs/test/FloydWarshall.test.jspassed cleanly. All repository test suites pass.Testing
npm test -- Graphs/test/FloydWarshall.test.js- all 6 tests passed.python3 work/R50-T048/check.py- all 6 assertions passed and verified.Checklist
Additional Notes
Student: Aniruddha Bongale (Enrollment: E26B07F0827)
Task ID: R50-T048