Example #1
0
 private void EqualsDetectsDeltaForAllLocations(ReadOnlySequence <byte> slice, byte[] expected, int offset, int length)
 {
     Assert.Equal(length, slice.Length);
     Assert.True(slice.EqualsTo(new Span <byte>(expected, offset, length)));
     // change one byte in buffer, for every position
     for (int i = 0; i < length; i++)
     {
         expected[offset + i] ^= 42;
         Assert.False(slice.EqualsTo(new Span <byte>(expected, offset, length)));
         expected[offset + i] ^= 42;
     }
 }