Add another method to check valid parentheses in ValidParentheses.java (#5616)

This commit is contained in:
Taranjeet Singh Kalsi
2024-10-08 00:18:02 +05:30
committed by GitHub
parent 732f7c8458
commit 4a5bf39f8e
2 changed files with 21 additions and 0 deletions

View File

@ -10,15 +10,18 @@ public class ValidParenthesesTest {
@Test
void testOne() {
assertTrue(ValidParentheses.isValid("()"));
assertTrue(ValidParentheses.isValidParentheses("()"));
}
@Test
void testTwo() {
assertTrue(ValidParentheses.isValid("()[]{}"));
assertTrue(ValidParentheses.isValidParentheses("()[]{}"));
}
@Test
void testThree() {
assertFalse(ValidParentheses.isValid("(]"));
assertFalse(ValidParentheses.isValidParentheses("(]"));
}
}