Title: test(graphs): cover failure and empty-result behavior of FloydWarshall (R50-T048) by aniruddha-bongale · Pull Request #96 · S-AI-Projects/TheAlgorithms-JavaScript · GitHub
Open Graph Title: test(graphs): cover failure and empty-result behavior of FloydWarshall (R50-T048) by aniruddha-bongale · Pull Request #96 · S-AI-Projects/TheAlgorithms-JavaScript
X Title: test(graphs): cover failure and empty-result behavior of FloydWarshall (R50-T048) by aniruddha-bongale · Pull Request #96 · S-AI-Projects/TheAlgorithms-JavaScript
Description: Description Add comprehensive failure-path and empty-result coverage for FloydWarshall in Graphs/FloydWarshall.js, including unit tests in Graphs/test/FloydWarshall.test.js exercising 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 in work/R50-T048/check.py saving execution results to work/R50-T048/results.json. Related Issue Fixes: #48 Type of Change Documentation update Tests (adding missing tests or fixing existing tests) Changes Made Added detailed JSDoc documentation to FloydWarshall in Graphs/FloydWarshall.js explaining the preconditions and execution branches: Line 24: Precondition n = dist.length = 0 bypassing loop entry at Line 25 to execute early exit Line 35 (return dist), yielding the valid empty result []. Line 28: Condition dist[i][j] > dist[i][k] + dist[k][j] evaluates false for disconnected vertices, preserving the Infinity sentinel representing absent shortest paths. Explains in-place matrix mutation behavior and caller preservation. Created Graphs/test/FloydWarshall.test.js covering: Smallest valid input ([[0]]). Empty-result path ([]). Absent-path sentinel (Infinity) for disconnected components. Ordinary 4-vertex connected graph and directed 5-vertex weighted graph. Caller-owned sequential call validity (calling empty path followed immediately by ordinary call). Implemented work/R50-T048/check.py to run native tests, verify assertions on all fixtures with explicit precondition line references, and output work/R50-T048/results.json. Screenshots / Recordings All 6 tests in Graphs/test/FloydWarshall.test.js passed cleanly. All repository test suites pass. Testing Ran npm test -- Graphs/test/FloydWarshall.test.js - all 6 tests passed. Executed python3 work/R50-T048/check.py - all 6 assertions passed and verified. Confirmed Prettier code style check passes. Checklist My code follows the style guidelines of this project I have performed a self-review of my code I have commented my code, particularly in hard-to-understand areas I have added tests that prove my fix is effective or that my feature works New and existing unit tests pass locally with my changes Additional Notes Student: Aniruddha Bongale (Enrollment: E26B07F0827) Task ID: R50-T048
Open Graph Description: Description Add comprehensive failure-path and empty-result coverage for FloydWarshall in Graphs/FloydWarshall.js, including unit tests in Graphs/test/FloydWarshall.test.js exercising the smallest ...
X Description: Description Add comprehensive failure-path and empty-result coverage for FloydWarshall in Graphs/FloydWarshall.js, including unit tests in Graphs/test/FloydWarshall.test.js exercising the smallest ...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/96
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c08f5837-b7b0-38db-1232-4226db78b870 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8EAE:32D5FB:988642:CE7433:6B06DB03 |
| html-safe-nonce | a0097a099b02fb3e39e62f4f0311b84d0c843836cdaf0cb560a776e7088f25d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUFFOjMyRDVGQjo5ODg2NDI6Q0U3NDMzOjZCMDZEQjAzIiwidmlzaXRvcl9pZCI6Ijg3ODk2NjcwOTE1MDM4MzE4MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c018beb832b871b7741de47424f316a312291de4612521255f66bcd940eb108e |
| hovercard-subject-tag | pull_request:5436996005 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/96/files |
| twitter:image | https://avatars.githubusercontent.com/u/322111215?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/322111215?s=400&v=4 |
| og:image:alt | Description Add comprehensive failure-path and empty-result coverage for FloydWarshall in Graphs/FloydWarshall.js, including unit tests in Graphs/test/FloydWarshall.test.js exercising the smallest ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06cadd0061c549662a50be90eb5baba7608f00f521574931eec01db0deb9e636 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/S-AI-Projects/TheAlgorithms-JavaScript git https://github.com/S-AI-Projects/TheAlgorithms-JavaScript.git |
| octolytics-dimension-user_id | 351892385 |
| octolytics-dimension-user_login | S-AI-Projects |
| octolytics-dimension-repository_id | 1444142713 |
| octolytics-dimension-repository_nwo | S-AI-Projects/TheAlgorithms-JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 97086543 |
| octolytics-dimension-repository_parent_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6953c712585a8d7406b7695e48fffcb670fd241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width