}
[Fact]
+ public static void SequenceCompareToEqual_Byte()
+ {
+ for (int length = 1; length < 128; length++)
+ {
+ var first = new byte[length];
+ var second = new byte[length];
+ for (int i = 0; i < length; i++)
+ {
+ first[i] = second[i] = (byte)(i + 1);
+ }
+
+ var firstSpan = new ReadOnlySpan<byte>(first);
+ var secondSpan = new ReadOnlySpan<byte>(second);
+
+ Assert.Equal(0, firstSpan.SequenceCompareTo<byte>(secondSpan));
+ Assert.Equal(0, secondSpan.SequenceCompareTo<byte>(firstSpan));
+ }
+ }
+
+ [Fact]
public static void SequenceCompareToWithSingleMismatch_Byte()
{
- for (int length = 1; length < 32; length++)
+ for (int length = 1; length < 128; length++)
{
for (int mismatchIndex = 0; mismatchIndex < length; mismatchIndex++)
{
[Fact]
public static void SequenceCompareToNoMatch_Byte()
{
- for (int length = 1; length < 32; length++)
+ for (int length = 1; length < 128; length++)
{
var first = new byte[length];
var second = new byte[length];
}
[Fact]
+ public static void SequenceCompareToEqual_Byte()
+ {
+ for (int length = 1; length < 128; length++)
+ {
+ var first = new byte[length];
+ var second = new byte[length];
+ for (int i = 0; i < length; i++)
+ {
+ first[i] = second[i] = (byte)(i + 1);
+ }
+
+ var firstSpan = new Span<byte>(first);
+ var secondSpan = new Span<byte>(second);
+
+ Assert.Equal(0, firstSpan.SequenceCompareTo<byte>(secondSpan));
+ Assert.Equal(0, secondSpan.SequenceCompareTo<byte>(firstSpan));
+ }
+ }
+
+ [Fact]
public static void SequenceCompareToWithSingleMismatch_Byte()
{
- for (int length = 1; length < 32; length++)
+ for (int length = 1; length < 128; length++)
{
for (int mismatchIndex = 0; mismatchIndex < length; mismatchIndex++)
{
[Fact]
public static void SequenceCompareToNoMatch_Byte()
{
- for (int length = 1; length < 32; length++)
+ for (int length = 1; length < 128; length++)
{
byte[] first = new byte[length];
byte[] second = new byte[length];