Back to problems

Implement Test Harness

Algorithm · Capital One · Easy

Create a test harness that receives a function together with test cases, then checks whether each returned value equals its expected value. Example Both calls produce the specified expected results. The first case succeeds, but the second call returns 7 rather than 8. Constraints Each test case contains an input value and the corresponding expected output. Return All tests passed when every case matches its expectation. Otherwise, report the number of the first test case…

Checking your access…