diff --git a/test/unify/RuleSetTest.java b/test/unify/RuleSetTest.java index dc52c9ec..b43f396c 100644 --- a/test/unify/RuleSetTest.java +++ b/test/unify/RuleSetTest.java @@ -199,7 +199,26 @@ public class RuleSetTest { @Test public void testErase3() { + TypeFactory tf = new TypeFactory(); + RuleSet rules = new RuleSet(new FiniteClosureBuilder().getFiniteClosure()); + /* + * Positive Tests + */ + MPair erase1 = new MPair(tf.getSimpleType("List", "T"), tf.getSimpleType("List", "T"), PairOperator.EQUALSDOT); + MPair erase2 = new MPair(tf.getPlaceholderType("W"), tf.getPlaceholderType("W"), PairOperator.EQUALSDOT); + + Assert.assertTrue(rules.erase3(erase1)); + Assert.assertTrue(rules.erase3(erase2)); + + /* + * Negative Tests + */ + MPair noerase1 = new MPair(tf.getSimpleType("Collection"), tf.getSimpleType("List", "T"), PairOperator.EQUALSDOT); + MPair noerase2 = new MPair(tf.getSimpleType("List", "T"), tf.getSimpleType("List", "T"), PairOperator.SMALLERDOT); + + Assert.assertFalse(rules.erase3(noerase1)); + Assert.assertFalse(rules.erase3(noerase2)); } @Test