Question: 7 . Add Tests for matching _ parens The function matching _ parens is new, though it is similar to first _ in _ parens

7. Add Tests for matching_parens
The function matching_parens is new, though it is similar to first_in_parens in several ways. First of all, you should include all combinations of parentheses that you did in your tests for first_in_parens. However, matching_parens does not care about what is inside a pair of parentheses, so a test A () C with nothing inside parentheses is the same as a test "A (B) C". In addition, matching_parens has a less restrictive precondition, and so it allows possibilities that first_in_parens does not, such as no parentheses or just one half of a pair of parentheses.
Design several test cases for matching_parens and add them to the test procedure tests_matching_parens. You should have at least 7 significantly different tests.
NOTE: You are expected to use the assert_equals, assert_true, assert_false functions from the introcs module to write tests_matching_parens. Do not use any other assert_ function in the Asserting Tests section of the IntroCS documentation. If you use one of the assert_true or assert_false functions, do not include not as part of the argument. For example, you would use assert_true(result) instead of assert_false(not result) or assert_false(result) instead of assert_true(not result).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!