Title: test(search): define supported boundaries of quickSelectSearch (R50-T042) by aniruddha-bongale · Pull Request #90 · S-AI-Projects/TheAlgorithms-JavaScript · GitHub
Open Graph Title: test(search): define supported boundaries of quickSelectSearch (R50-T042) by aniruddha-bongale · Pull Request #90 · S-AI-Projects/TheAlgorithms-JavaScript
X Title: test(search): define supported boundaries of quickSelectSearch (R50-T042) by aniruddha-bongale · Pull Request #90 · S-AI-Projects/TheAlgorithms-JavaScript
Description: Description This PR addresses task R50-T042 for quickSelectSearch. It documents the supported domain boundaries in Search/QuickSelectSearch.js citing the source preconditions established at Line 15 (if (!array || array.length <= k)), establishes a focused boundary test suite asserting both valid and explicitly unsupported sides of every boundary, and introduces an automated check runner work/R50-T042/check.py. Related Issue Fixes: #42 Type of Change Tests Documentation Refactoring / Maintenance Changes Made Documented the supported boundary contract in Search/QuickSelectSearch.js citing precondition checks at Line 15 (if (!array || array.length <= k)) and error handling at Line 16 (throw new Error('Invalid arguments')). Created Search/test/QuickSelectSearch.test.js covering: Stated fixture with the smallest valid input ([42], k = 0) asserting expected value [42] and array identity. Stated fixture with an ordinary unsorted 9-element input (k = 4, median) asserting partition guarantees. Lower supported boundary ($k = 0$) and upper supported boundary ($k = array.length - 1$). Two-element boundary cases and repeated elements boundary. Explicitly unsupported boundaries on the invalid side: $k = array.length$, $k > array.length$, empty array ([]), and falsy arrays (null, undefined) asserting Error('Invalid arguments'). Implemented automated check runner work/R50-T042/check.py and saved verifiable execution evidence in work/R50-T042/results.json. Screenshots / Recordings N/A (Algorithmic / unit testing suite) Testing Ran Prettier style checks: npx prettier --check Search/QuickSelectSearch.js Search/test/QuickSelectSearch.test.js work/R50-T042/results.json Ran native Vitest suite: npm test -- Search/test/QuickSelectSearch.test.js (10 tests passed) Ran full repository test suite via pre-commit hook (347 test files, 11,980 tests passed) Ran automated check runner: python3 work/R50-T042/check.py (all checks and tool version captures passed) Checklist I have tested my changes locally. I have added or updated tests, if needed. I have updated documentation, if needed. I have followed the project's coding guidelines. I have run the relevant tests and checks. I have addressed previous review feedback, if applicable. Additional Notes Precondition source line 15 is explicitly cited in code comments, test descriptions, and automated check results. No arbitrary TypeError/RangeError policies are imposed across unrelated functions.
Open Graph Description: Description This PR addresses task R50-T042 for quickSelectSearch. It documents the supported domain boundaries in Search/QuickSelectSearch.js citing the source preconditions established at Line 15...
X Description: Description This PR addresses task R50-T042 for quickSelectSearch. It documents the supported domain boundaries in Search/QuickSelectSearch.js citing the source preconditions established at Line 15...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/90
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
| 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:2a402c76-c5d6-69b0-9a68-cf316c9c65d9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A658:A3A21:19229A7:22E63D7:6B06DAD0 |
| html-safe-nonce | fc6e3a92ee41c56f3f477c40ad801357bcfa08d02400b659c462eb528ed5f27d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjU4OkEzQTIxOjE5MjI5QTc6MjJFNjNENzo2QjA2REFEMCIsInZpc2l0b3JfaWQiOiI1MTcwNjQwMTYzNzA1Mzc5NTM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 54833682b6a8906c4586d1365b2fafab74fc4aa5e0617e55ee26a082857731ec |
| hovercard-subject-tag | pull_request:5436432406 |
| 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/90/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 This PR addresses task R50-T042 for quickSelectSearch. It documents the supported domain boundaries in Search/QuickSelectSearch.js citing the source preconditions established at Line 15... |
| 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