Skip to content

Commit

Permalink
Add test cases for Recursion Part 1 Bracket Match
Browse files Browse the repository at this point in the history
Previously, a naive non-recursive solution that only checked the outermost brackets (and even/odd length) would pass all test cases.
  • Loading branch information
ian-ludden committed Oct 25, 2024
1 parent 7ae385e commit b895917
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Homework/HWRecursion/src/recursionPart1Test/TestBracketMatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,15 @@ public void testBracketMatch07() {
public void testBracketMatch08() {
assertEquals(false, Part1Problems.bracketMatch("(((<>))"));
} // testBracketMatch08

@Test
public void testBracketMatch09() {
assertEquals(false, Part1Problems.bracketMatch("(<<)"));
} // testBracketMatch09

@Test
public void testBracketMatch10() {
assertEquals(false, Part1Problems.bracketMatch("[}}]"));
} // testBracketMatch09

} // end TestBracketMatch

0 comments on commit b895917

Please sign in to comment.