Title: test: add regression tests for change() in CoinChange.js (R50-T031) by nishadaniket174 · Pull Request #69 · S-AI-Projects/TheAlgorithms-JavaScript · GitHub
Open Graph Title: test: add regression tests for change() in CoinChange.js (R50-T031) by nishadaniket174 · Pull Request #69 · S-AI-Projects/TheAlgorithms-JavaScript
X Title: test: add regression tests for change() in CoinChange.js (R50-T031) by nishadaniket174 · Pull Request #69 · S-AI-Projects/TheAlgorithms-JavaScript
Description: Description This PR adds regression tests for the change() function in Dynamic-Programming/CoinChange.js as part of Task R50-T031. The main goal is to make sure the function continues to return the correct number of ways to make a given amount using the available coin denominations. What has been tested? Three different scenarios have been covered: 1. Smallest valid input coins = [] amount = 0 expected = 1 When the target amount is zero, there is exactly one possible way to make it: by choosing no coins. 2. Normal input coins = [1, 2, 5] amount = 5 expected = 4 There are four ways to make the amount 5: 1 + 1 + 1 + 1 + 1 1 + 1 + 1 + 2 1 + 2 + 2 5 The function should return 4. 3. Repeated coin values and an impossible amount coins = [2, 2] amount = 1 expected = 0 Since neither coin can be used to make the amount 1, the function should return 0. Additional checks Checked that the original coins array is not modified when the function is called. Added clear expected results so that any incorrect output can be identified easily. Reviewed the implementation to understand the conditions and behavior being tested. Running the tests The task's focused test runner can be executed using: python3 work/R50-T031/check.py Execution results and environment details are recorded in: work/R50-T031/execution_log_R50_T031.txt Task Information Task: R50-T031 Related Issue: #31 Function: change() File: Dynamic-Programming/CoinChange.js These tests are intended to protect the existing behavior of change() and make it easier to catch unexpected changes in the future. Closes #31
Open Graph Description: Description This PR adds regression tests for the change() function in Dynamic-Programming/CoinChange.js as part of Task R50-T031. The main goal is to make sure the function continues to return the...
X Description: Description This PR adds regression tests for the change() function in Dynamic-Programming/CoinChange.js as part of Task R50-T031. The main goal is to make sure the function continues to return the...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/69
X: @github
Domain: github.com
| 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:5545e896-7834-1d21-9b4e-039855e089fb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CF9A:215B92:2E08D71:3D528E6:6B01D75C |
| html-safe-nonce | 7c153e011de1af1e729454ef3aa80395ffe9ce9eb89ee2fc5ac4fd2f722cbba9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjlBOjIxNUI5MjoyRTA4RDcxOjNENTI4RTY6NkIwMUQ3NUMiLCJ2aXNpdG9yX2lkIjoiODQ1NTQ0ODA1OTk0OTc3MTE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a3ff5dd1bc0c1128457f426c1dbf6d6a08774ba5cb242fd962ed0e79b71c47de |
| hovercard-subject-tag | pull_request:5283195202 |
| 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/69/files |
| twitter:image | https://avatars.githubusercontent.com/u/334835973?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/334835973?s=400&v=4 |
| og:image:alt | Description This PR adds regression tests for the change() function in Dynamic-Programming/CoinChange.js as part of Task R50-T031. The main goal is to make sure the function continues to return the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width