Repository navigation
test: add regression tests for change() in CoinChange.js (R50-T031) - #69
Open
nishadaniket174 wants to merge 1 commit into
Open
nishadaniket174 wants to merge 1 commit into
nishadaniket174 wants to merge 1 commit into
Conversation
4 tasks
nishadaniket174
force-pushed
the
student/e26b07f0789/R50-T031
branch
from
November 21, 2026 13:21
e0546b6 to
e8031ba
Compare
Author
|
requesting instructor review. |
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 adds regression tests for the
change()function inDynamic-Programming/CoinChange.jsas 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
When the target amount is zero, there is exactly one possible way to make it: by choosing no coins.
2. Normal input
There are four ways to make the amount 5:
The function should return
4.3. Repeated coin values and an impossible amount
Since neither coin can be used to make the amount 1, the function should return
0.Additional checks
coinsarray is not modified when the function is called.Running the tests
The task's focused test runner can be executed using:
Execution results and environment details are recorded in:
Task Information
change()Dynamic-Programming/CoinChange.jsThese tests are intended to protect the existing behavior of
change()and make it easier to catch unexpected changes in the future.Closes #31