| assertTrue("Test if set contains another set", !set2.contains(set));
}
public void testEquals()
{
ItemSet set = new ItemSet(grammar, firstsets);
set.addItem(0, 0, eof);
set.addItem(1, 0, c);
set.addItem(1, 0, d);
set.addItem(2, 0, c);
set.addItem(2, 0, d);
ItemSet set2 = new ItemSet(grammar, firstsets);
set2.addItem(0, 0, eof);
set2.addItem(1, 0, c);
set2.addItem(1, 0, d);
set2.addItem(2, 0, c);
set2.addItem(2, 0, d);
assertEquals("Test if sets are equal", set, set2);
set = new ItemSet(grammar, firstsets);
set.addItem(0, 0, eof);
set.addItem(1, 0, c);
set.addItem(1, 0, d);
set.addItem(2, 0, c);
set.addItem(2, 0, d);
set2 = new ItemSet(grammar, firstsets);
set2.addItem(1, 0, d);
set2.addItem(2, 0, c);
set2.addItem(2, 0, d);
set2.addItem(0, 0, eof);
set2.addItem(1, 0, c);
assertEquals("Test if sets are equal", set, set2);
set = new ItemSet(grammar, firstsets);
set.addItem(0, 0, eof);
set.addItem(1, 0, c);
set.addItem(1, 0, d);
set.addItem(2, 0, c);
set.addItem(2, 0, d);
set2 = new ItemSet(grammar, firstsets);
set2.addItem(0, 0, eof);
set2.addItem(1, 0, c);
set2.addItem(1, 0, eof);
set2.addItem(2, 0, c);
set2.addItem(2, 0, d);
assertNotEquals("Test if sets are not equal", set, set2);
set = new ItemSet(grammar, firstsets);
set.addItem(0, 0, eof);
set.addItem(1, 0, c);
set.addItem(1, 0, d);
set.addItem(2, 0, c);
set.addItem(2, 0, d);
set2 = new ItemSet(grammar, firstsets);
set2.addItem(0, 0, eof);
set2.addItem(0, 0, c);
set2.addItem(1, 0, d);
set2.addItem(2, 0, c);
set2.addItem(2, 0, d);
assertNotEquals("Test if sets are not equal", set, set2);
}
|