/**
* Tests for typeMatching.
*/
@Test
public final void testTypeMatching() {
final ExpressionMatcher matcher = new ExpressionMatcher();
final Expression e1 = new Expression("abc", "VER");
final Expression e2 = new Expression("abc", "VER");
final Expression e3 = new Expression("ab", "VER");
final Expression e4 = new Expression("abc", "SUB");
final Expression e5 = new Expression("X", "SUB");
matcher.setTypeMatching(false);
matcher.setExactMatching(false);
assertTrue(matcher.match(e1, e2));
assertFalse(matcher.match(e1, e3));
assertTrue(matcher.match(e1, e4));
assertFalse(matcher.match(e1, e5));
assertFalse(matcher.match(e4, e5));
matcher.setTypeMatching(true);
matcher.setExactMatching(false);
assertTrue(matcher.match(e1, e2));
assertFalse(matcher.match(e1, e3));
assertFalse(matcher.match(e1, e4));
assertFalse(matcher.match(e1, e5));
assertFalse(matcher.match(e4, e5));
matcher.setTypeMatching(true);
matcher.setExactMatching(true);
assertTrue(matcher.match(e1, e2));
assertFalse(matcher.match(e1, e3));
assertFalse(matcher.match(e1, e4));
assertFalse(matcher.match(e1, e5));
assertFalse(matcher.match(e4, e5));
matcher.setTypeMatching(false);
matcher.setExactMatching(true);
assertTrue(matcher.match(e1, e2));
assertFalse(matcher.match(e1, e3));
assertTrue(matcher.match(e1, e4));
assertFalse(matcher.match(e1, e5));
assertFalse(matcher.match(e4, e5));
}