bracket-push: Add test case "partially paired brackets"#1219
bracket-push: Add test case "partially paired brackets"#1219rpottsoh merged 1 commit intoexercism:masterfrom
Conversation
petertseng
left a comment
There was a problem hiding this comment.
I confirm that such a described implementation (early return) passes all tests but not the new one.
Please designate that in the commit message. The PR description was good because it explains why the test case is added; the information should be in the commit message as well so that the information is visible without having to visit GitHub.
Commits should be squashed.
If nothing else, around 24 hours from now I will make both things happen.
* Bump version to v1.3.0 * Guard against solutions returning `true` once brackets are matched, which will pass all previous tests but the added one
1b91f69 to
4b84fed
Compare
|
@petertseng Done at your request. |
petertseng
left a comment
There was a problem hiding this comment.
cool. I could quibble a bit about "once brackets are matched" -> "once any one pair of brackets is matched" to really distinguish it from solutions that check all pairs of brackets as they should, but I haven't the time to write down all my thoughts, and it's good as-is anyway.
Guards against solutions immediately declaring the entire string matched as soon as they find any one matched pair. exercism/problem-specifications#1219
Guards against solutions immediately declaring the entire string matched as soon as they find any one matched pair. exercism/problem-specifications#1219
Guards against solutions immediately declaring the entire string matched as soon as they find any one matched pair. exercism/problem-specifications#1219
add test `partially paired brackets` per exercism/problem-specifications#1219
Some incorrect solutions return
trueas soon as brackets are matched. Check out this solution in Python which can pass all current tests:Clearly
return brackets_match(top_of_stack, char)within theforloop is wrong, so it will fail test cases where brackets are partially paired, like{[]).