public void TestEmptyIntersection() { IntervalSet s = IntervalSet.Of('a', 'z'); IntervalSet s2 = IntervalSet.Of('0', '9'); String expecting = "{}"; String result = (s.And(s2)).ToString(); Assert.AreEqual(expecting, result); }
public void TestRangeAndIsolatedElement() { IntervalSet s = IntervalSet.Of('a', 'z'); IntervalSet s2 = IntervalSet.Of('d'); String expecting = "100"; String result = (s.And(s2)).ToString(); Assert.AreEqual(expecting, result); }
public void TestSimpleAnd() { IntervalSet s = IntervalSet.Of(10, 20); IntervalSet s2 = IntervalSet.Of(13, 15); String expecting = "{13..15}"; String result = (s.And(s2)).ToString(); Assert.AreEqual(expecting, result); }
public void TestEmptyIntersectionSingleElements() { IntervalSet s = IntervalSet.Of('a'); IntervalSet s2 = IntervalSet.Of('d'); String expecting = "{}"; String result = (s.And(s2)).ToString(); Assert.AreEqual(expecting, result); }
public void TestIntersectionWithTwoContainedElementsReversed() { IntervalSet s = IntervalSet.Of(10, 20); IntervalSet s2 = IntervalSet.Of(2, 2); s2.Add(15); s2.Add(18); String expecting = "{15, 18}"; String result = (s2.And(s)).ToString(); Assert.AreEqual(expecting, result); }
public void TestNotRIntersectionNotT() { IntervalSet s = IntervalSet.Of(0, 's'); s.Add('u', 200); IntervalSet s2 = IntervalSet.Of(0, 'q'); s2.Add('s', 200); String expecting = "{0..113, 115, 117..200}"; String result = (s.And(s2)).ToString(); Assert.AreEqual(expecting, result); }