public void IncludeAndExcludeMakesEmpty() { var l = new PtrLenList(); l.TryInclude(0, 1); Assert.True(l.TryExclude(0, 1)); Assert.True(l.Empty); }
public void EmptyExcludeIsNoop() { var l = new PtrLenList(); l.TryInclude(0, 2); Assert.True(l.TryExclude(1, 0)); Assert.Equal("0-2", Str(l)); }
public void SpanExclude4() { var l = new PtrLenList(); for (uint i = 0; i < 10; i++) { Assert.IsTrue(l.TryInclude(i * 4, 2)); } Assert.IsFalse(l.TryExclude(16, 17)); Assert.AreEqual("0-2;4-6;8-10;12-14;33-34;36-38", Str(l)); }
public void SpanExclude3() { var l = new PtrLenList(); for (uint i = 0; i < 10; i++) { Assert.IsTrue(l.TryInclude(i * 4, 2)); } Assert.IsFalse(l.TryExclude(24, 20)); Assert.AreEqual("0-2;4-6;8-10;12-14;16-18;20-22", Str(l)); }
public void SpanExclude() { var l = new PtrLenList(); for (uint i = 0; i < 10; i++) { Assert.IsTrue(l.TryInclude(i * 4, 2)); } Assert.IsFalse(l.TryExclude(5, 30)); Assert.AreEqual("0-2;4-5;36-38", Str(l)); }
public void OnEmptyExcludeFails() { var l = new PtrLenList(); Assert.IsFalse(l.TryExclude(0, 1)); }
public void ExcludeSplitRange() { var l = new PtrLenList(); l.TryInclude(0, 10); Assert.IsTrue(l.TryExclude(3, 2)); Assert.AreEqual("0-3;5-10", Str(l)); }
public void ExcludeFromStartOverlap() { var l = new PtrLenList(); l.TryInclude(1, 3); Assert.IsFalse(l.TryExclude(0, 2)); Assert.AreEqual("2-4", Str(l)); }
public void ExcludeFromStart() { var l = new PtrLenList(); l.TryInclude(0, 4); Assert.IsTrue(l.TryExclude(0, 2)); Assert.AreEqual("2-4", Str(l)); }
public void ExcludeFromEndOverlap() { var l = new PtrLenList(); l.TryInclude(0, 3); Assert.IsFalse(l.TryExclude(2, 2)); Assert.AreEqual("0-2", Str(l)); }
public void ExcludeFromEnd() { var l = new PtrLenList(); l.TryInclude(0, 4); Assert.IsTrue(l.TryExclude(2, 2)); Assert.AreEqual("0-2", Str(l)); }
public void SpanExclude2() { var l = new PtrLenList(); for (uint i = 0; i < 10; i++) { Assert.True(l.TryInclude(i * 4, 2)); } Assert.False(l.TryExclude(24, 10)); Assert.Equal("0-2;4-6;8-10;12-14;16-18;20-22;36-38", Str(l)); }