use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class AbstractPairMatcherTest method testBug377417.
@Test
public void testBug377417() {
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 testTightPartitioned.
/**
* Test that it works properly next to partition boundaries.
*
* @throws BadLocationException test failure
*/
@Test
public void testTightPartitioned() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "(|b)%b|");
performMatch(matcher, "(%|b)b|");
performMatch(matcher, "|a(a|)%");
performMatch(matcher, "|a(%a|)");
performMatch(matcher, "|c#(c|)(|c)%c|");
performMatch(matcher, "|c(%c|)(|c)#c|");
performMatch(matcher, "(%|a)a||b)b||c)c|)#");
performMatch(matcher, "|c#(c|)(|%c)#c|");
performMatch(matcher, "|c#(c%|)(|c)#c|");
performMatch(matcher, "#(%|a)a||b)b||c)c|)#");
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project eclipse.platform.text by eclipse.
the class DefaultPairMatcherTest2 method testSimpleMatchSameMatcher1.
/**
* Very simple checks.
*
* @throws BadLocationException test failure
*/
@Test
public void testSimpleMatchSameMatcher1() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "#( %)");
performMatch(matcher, "#[ %]");
performMatch(matcher, "#{ %}");
performMatch(matcher, "%( )#");
performMatch(matcher, "%[ ]#");
performMatch(matcher, "%{ }#");
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project webtools.sourceediting by eclipse.
the class AbstractPairMatcherTest method testIncompleteMatch.
/**
* Checks of simple situations where no matches should be found.
*
* @throws BadLocationException
*/
public void testIncompleteMatch() throws BadLocationException {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, "(% ");
performMatch(matcher, "%( )");
performMatch(matcher, "( % )");
performMatch(matcher, "( %)");
performMatch(matcher, "%");
matcher.dispose();
}
use of org.eclipse.jface.text.source.ICharacterPairMatcher in project webtools.sourceediting by eclipse.
the class AbstractPairMatcherTest method testNesting.
/**
* Test that nesting works properly
*/
public void testNesting() {
final ICharacterPairMatcher matcher = createMatcher("()[]{}");
performMatch(matcher, " ( #( ( ( ) ) ( ) )% ) ");
performMatch(matcher, " ( (% ( ( ) ) ( ) )# ) ");
performMatch(matcher, " ( #( { ( ) } [ ] )% ) ");
performMatch(matcher, " ( (% { ( ) } [ ] )# ) ");
performMatch(matcher, " ( ( #{ ( ) }% [ ] ) ) ");
performMatch(matcher, " ( ( {% ( ) }# [ ] ) ) ");
performMatch(matcher, "a(b#(c(d(e)f)g(h)i)%j)k");
performMatch(matcher, "a(b(%c(d(e)f)g(h)i)#j)k");
performMatch(matcher, "a(b#(c{d(e)f}g[h]i)%j)k");
performMatch(matcher, "a(b(%c{d(e)f}g[h]i)#j)k");
performMatch(matcher, "a(b(c#{d(e)f}%g[h]i)j)k");
performMatch(matcher, "a(b(c{%d(e)f}#g[h]i)j)k");
matcher.dispose();
}
Aggregations