use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class AbstractPairMatcherTest method testCloseMatches.
/**
* Close matches.
*
* @throws BadLocationException test failure
*/
@Test
public void testCloseMatches() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "(%)#");
performMatch(matcher, "#(())%");
performMatch(matcher, "(%())#");
performMatch(matcher, "((%)#)");
performMatch(matcher, "%(%)#");
performMatch(matcher, "#(()%)%");
performMatch(matcher, "%(%())#");
performMatch(matcher, "(%(%)#)");
performMatch(matcher, "#(%)#");
performMatch(matcher, "#(%())#");
performMatch(matcher, "#(% %)#");
performMatch(matcher, "#(% %())#");
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class AbstractPairMatcherTest method testIncompleteMatch.
/**
* Checks of simple situations where no matches should be found.
*
* @throws BadLocationException test failure
*/
@Test
public void testIncompleteMatch() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "(% ");
performMatch(matcher, "( % )");
performMatch(matcher, "%");
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class AbstractPairMatcherTest method performMatch.
private void performMatch(final String delims, final String testCase) {
final ICharacterPairMatcher matcher = createMatcher(delims);
performMatch(matcher, testCase);
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class DefaultPairMatcherTest method testIncompleteMatch1.
/**
* Checks of simple situations where no matches should be found.
*
* @throws BadLocationException test failure
*/
@Test
public void testIncompleteMatch1() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "( %)");
performMatch(matcher, "%( )");
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class DefaultPairMatcherTest method testCloseMatches1.
/**
* Close matches.
*
* @throws BadLocationException test failure
*/
@Test
public void testCloseMatches1() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "#()%");
performMatch(matcher, "(#()%)");
matcher.dispose();
}
Aggregations