System.SpanTests.ReadOnlySpanTests.SliceIntIntPastEnd C# (CSharp) Method

SliceIntIntPastEnd() private method

private SliceIntIntPastEnd ( ) : void
return void
        public static void SliceIntIntPastEnd()
        {
            int[] a = { 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
            ReadOnlySpan<int> span = new ReadOnlySpan<int>(a).Slice(a.Length, 0);
            Assert.Equal(0, span.Length);
            Assert.True(Unsafe.AreSame<int>(ref a[a.Length - 1], ref Unsafe.Subtract<int>(ref span.DangerousGetPinnableReference(), 1)));
        }