public unsafe void GetSegment_Invalid() { char *ch = stackalloc char[4]; Assert.IsFalse(ABSRegistry.GetSegment("$AG:", ch, out _, out _)); Assert.IsFalse(ABSRegistry.GetSegment("XYZ:", ch, out _, out _)); Assert.IsFalse(ABSRegistry.GetSegment("abc", ch, out _, out _)); }
public unsafe void GetSegment_Alias_Valid() { var newSegment = new RegSegment(); ABSRegistry.SegmentAliases.Add("abc", newSegment); char *ch = stackalloc char[4]; Assert.IsTrue(ABSRegistry.GetSegment("$abc:", ch, out int pos, out RegSegment segment)); Assert.AreEqual(newSegment, segment); Assert.AreEqual(5, pos); }