}
}
}
+
+ @Test(groups = { "Functional" })
+ public void testGetMatchingOpeningParenthesis() throws WUSSParseException
+ {
+ for (int i = 0; i <= 255; i++)
+ {
+ boolean isClosing = Rna.isClosingParenthesis((char) i);
+ if (isClosing)
+ {
+ char opening = Rna.getMatchingOpeningParenthesis((char) i);
+ if (i >= 'a' && i <= 'z')
+ {
+ assertEquals(i + 'A' - 'a', opening);
+ }
+ else if (i == ')' && opening == '(' || i == ']' && opening == '['
+ || i == '}' && opening == '{' || i == '>' && opening == '<')
+ {
+ // ok
+ }
+ else
+ {
+ fail("Got " + opening + " as opening bracket pair for "
+ + ((char) i));
+ }
+ }
+ }
+ }
}