use of kodkod.util.ints.IntTreeSet in project org.alloytools.alloy by AlloyTools.
the class BugTests method testVincent_02132006.
public final void testVincent_02132006() {
IntTreeSet set = new IntTreeSet();
for (int i = 0; i < 2; i++) {
set.add(i);
}
IntTreeSet set2 = new IntTreeSet();
for (int i = 0; i < 2; i++) {
set2.add(i);
}
set.removeAll(set2);
IntIterator setIterator = set.iterator();
assertFalse(setIterator.hasNext());
assertFalse(setIterator.hasNext());
set.addAll(set2);
assertSameContents(set, 0, 1);
set2.clear();
for (int i = 3; i < 5; i++) {
set2.add(i);
}
set.addAll(set2);
assertSameContents(set, 0, 1, 3, 4);
set2.clear();
for (int i = 1; i < 4; i++) {
set2.add(i);
}
set.addAll(set2);
assertSameContents(set, 0, 1, 2, 3, 4);
}
use of kodkod.util.ints.IntTreeSet in project org.alloytools.alloy by AlloyTools.
the class BugTests method testEmina_02162006.
public final void testEmina_02162006() {
final IntTreeSet s = new IntTreeSet();
for (int i = 0; i < 5; i++) {
s.add(i);
}
final IntTreeSet s1 = new IntTreeSet();
s1.add(0);
final IntSet intersection = new IntTreeSet(s);
intersection.retainAll(s1);
s.removeAll(intersection);
assertSameContents(s, 1, 2, 3, 4);
assertSameContents(s1, 0);
assertSameContents(intersection, 0);
}
Aggregations