Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 28 additions & 27 deletions src/Common/tests/Tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public partial class StringTests
private const string SoftHyphen = "\u00AD";
private static readonly char[] s_whiteSpaceCharacters = { '\u0009', '\u000a', '\u000b', '\u000c', '\u000d', '\u0020', '\u0085', '\u00a0', '\u1680' };

#pragma warning disable xUnit2009 // Do not use Assert.True/False to check for Substrings
// This warning is irrelevant for the majority of this test, since we want to test the functionality of the methods themselves,
// rather than checking for substrings. If we enable the warning, we have to depend on the assertion methods calling these methods
// internally, which is not ideal.

[Theory]
[InlineData(new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', '\0' }, "abcdefgh")]
[InlineData(new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', '\0', 'i', 'j' }, "abcdefgh")]
Expand Down Expand Up @@ -78,7 +83,9 @@ public static unsafe void Ctor_CharPtr_OddAddressShouldStillWork()
[InlineData(new char[] { '\0' }, 0, 1, "\0")]
[InlineData(new char[] { 'a', 'b', 'c' }, 0, 0, "")]
[InlineData(new char[] { 'a', 'b', 'c' }, 1, 0, "")]
#pragma warning disable xUnit1026 // Unused parameter
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a bug in the analyser. Suppressed for now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static unsafe void Ctor_CharPtr_Int_Int(char[] valueArray, int startIndex, int length, string expected)
#pragma warning restore xUnit1026 // Unused parameter
{
fixed (char* value = valueArray)
{
Expand Down Expand Up @@ -549,9 +556,7 @@ public static void CopyTo_Invalid()
[InlineData("HELLO", 2, "hello", 2, 3, StringComparison.Ordinal, -1)]
[InlineData("Hello", 2, "Goodbye", 2, 3, StringComparison.Ordinal, -1)]
[InlineData("Hello", 0, "Hello", 0, 0, StringComparison.Ordinal, 0)]
[InlineData("Hello", 0, "Hello", 0, 5, StringComparison.Ordinal, 0)]
[InlineData("Hello", 0, "Hello", 0, 3, StringComparison.Ordinal, 0)]
[InlineData("Hello", 2, "Hello", 2, 3, StringComparison.Ordinal, 0)]
[InlineData("Hello", 0, "He" + SoftHyphen + "llo", 0, 5, StringComparison.Ordinal, -1)]
[InlineData("Hello", 0, "-=<Hello>=-", 3, 5, StringComparison.Ordinal, 0)]
[InlineData("\uD83D\uDD53Hello\uD83D\uDD50", 1, "\uD83D\uDD53Hello\uD83D\uDD54", 1, 7, StringComparison.Ordinal, 0)] // Surrogate split
Expand Down Expand Up @@ -982,7 +987,7 @@ public static void CompareToNoMatch_StringComparison()

string s1 = new string(first);
string s2 = new string(second);
Assert.True(0 > string.Compare(s1, s2, StringComparison.Ordinal));
Assert.True(0 > string.Compare(s1, s2, StringComparison.Ordinal));

var firstSpan = new ReadOnlySpan<char>(first);
var secondSpan = new ReadOnlySpan<char>(second);
Expand Down Expand Up @@ -1208,7 +1213,7 @@ public static void ContainsMatch_StringComparison()
Assert.True(s1.Contains(s2));

ReadOnlySpan<char> span = value.AsSpan(0, 3);
ReadOnlySpan<char> slice = value.AsSpan(0 ,2);
ReadOnlySpan<char> slice = value.AsSpan(0, 2);
Assert.True(span.Contains(slice, StringComparison.Ordinal));

Assert.True(span.Contains(slice, StringComparison.CurrentCulture));
Expand Down Expand Up @@ -1796,7 +1801,7 @@ public static void SameSpanEndsWith_Char()
[Fact]
public static void LengthMismatchEndsWith_Char()
{
string value = "456";;
string value = "456";

string s1 = value.Substring(0, 2);
string s2 = value.Substring(0, 3);
Expand Down Expand Up @@ -1837,7 +1842,7 @@ public static void EndsWithMatchDifferentSpans_Char()
Assert.True(c);

ReadOnlySpan<char> span = value1.AsSpan(0, 3);
ReadOnlySpan<char> slice = value2.AsSpan(0 ,3);
ReadOnlySpan<char> slice = value2.AsSpan(0, 3);
c = span.EndsWith(slice);
Assert.True(c);
}
Expand Down Expand Up @@ -1982,7 +1987,7 @@ public static void LengthMismatchEndsWith_StringComparison()
Assert.False(s1.EndsWith(s2, StringComparison.InvariantCultureIgnoreCase));
Assert.False(s1.EndsWith(s2, StringComparison.OrdinalIgnoreCase));

ReadOnlySpan<char> span = value.AsSpan(0 ,2);
ReadOnlySpan<char> span = value.AsSpan(0, 2);
ReadOnlySpan<char> slice = value.AsSpan(0, 3);
Assert.False(span.EndsWith(slice, StringComparison.Ordinal));

Expand All @@ -2009,7 +2014,7 @@ public static void EndsWithMatch_StringComparison()
Assert.True(s1.EndsWith(s2, StringComparison.OrdinalIgnoreCase));

ReadOnlySpan<char> span = value.AsSpan(0, 3);
ReadOnlySpan<char> slice = value.AsSpan(1 ,2);
ReadOnlySpan<char> slice = value.AsSpan(1, 2);
Assert.True(span.EndsWith(slice, StringComparison.Ordinal));

Assert.True(span.EndsWith(slice, StringComparison.CurrentCulture));
Expand Down Expand Up @@ -2494,7 +2499,7 @@ public static void GetHashCode_EmbeddedNull_ReturnsDifferentHashCodes()
[InlineData("", "", StringComparison.OrdinalIgnoreCase, true)]
[InlineData("123", 123, StringComparison.OrdinalIgnoreCase, false)] // Not a string
[InlineData("\0AAAAAAAAA", "\0BBBBBBBBBBBB", StringComparison.OrdinalIgnoreCase, false)]
public static void Equals(string s1, object obj, StringComparison comparisonType, bool expected)
public static void Equals_Test(string s1, object obj, StringComparison comparisonType, bool expected)
Copy link
Author

@Gnbrkm41 Gnbrkm41 Jun 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the name of this purely because the analyser complained that this becomes an overload of object.Equals(object). Shall I suppress it instead?

{
string s2 = obj as string;
if (s1 != null)
Expand Down Expand Up @@ -2622,6 +2627,7 @@ public static void Format_Invalid()
Assert.Throws<FormatException>(() => string.Format(formatter, "{-1}", obj1, obj2, obj3, obj4));

// Format has out of range value
#pragma warning disable IDE0043 // Format string contains invalid placeholder
Assert.Throws<FormatException>(() => string.Format("{1}", obj1));
Assert.Throws<FormatException>(() => string.Format("{2}", obj1, obj2));
Assert.Throws<FormatException>(() => string.Format("{3}", obj1, obj2, obj3));
Expand All @@ -2630,6 +2636,7 @@ public static void Format_Invalid()
Assert.Throws<FormatException>(() => string.Format(formatter, "{2}", obj1, obj2));
Assert.Throws<FormatException>(() => string.Format(formatter, "{3}", obj1, obj2, obj3));
Assert.Throws<FormatException>(() => string.Format(formatter, "{4}", obj1, obj2, obj3, obj4));
#pragma warning restore IDE0043 // Format string contains invalid placeholder
}

[Theory]
Expand All @@ -2642,8 +2649,6 @@ public static void Format_Invalid()
[InlineData("Hello", 'l', 3, 0, -1)]
[InlineData("Hello", 'l', 0, 2, -1)]
[InlineData("Hello", 'l', 0, 3, 2)]
[InlineData("Hello", 'l', 4, 1, -1)]
[InlineData("Hello", 'x', 1, 4, -1)]
[InlineData("Hello", 'o', 5, 0, -1)]
[InlineData("H" + SoftHyphen + "ello", 'e', 0, 3, 2)]
// For some reason, this is failing on *nix with ordinal comparisons.
Expand Down Expand Up @@ -3841,13 +3846,9 @@ public static void Join_ObjectArray_Null_ThrowsArgumentNullException()
[InlineData("Hello", 'l', 1, 2, -1)]
[InlineData("Hello", 'l', 0, 1, -1)]
[InlineData("Hello", 'x', 3, 4, -1)]
[InlineData("Hello", 'l', 3, 4, 3)]
[InlineData("Hello", 'l', 1, 2, -1)]
[InlineData("Hello", 'l', 1, 0, -1)]
[InlineData("Hello", 'l', 4, 2, 3)]
[InlineData("Hello", 'l', 4, 3, 3)]
[InlineData("Hello", 'l', 0, 1, -1)]
[InlineData("Hello", 'x', 3, 4, -1)]
[InlineData("H" + SoftHyphen + "ello", 'H', 2, 3, 0)]
[InlineData("", 'H', 0, 0, -1)]
public static void LastIndexOf_SingleLetter(string s, char value, int startIndex, int count, int expected)
Expand Down Expand Up @@ -5242,7 +5243,7 @@ public static void LengthMismatchToLower()
}

[Fact]
public static void ToLower()
public static void ToLower_Span()
{
var expectedSource = new char[3] { 'a', 'B', 'c' };
var expectedDestination = new char[3] { 'a', 'b', 'c' };
Expand Down Expand Up @@ -5448,7 +5449,7 @@ public static void LengthMismatchToUpper()
}

[Fact]
public static void ToUpper()
public static void ToUpper_Span()
{
var expectedSource = new char[3] { 'a', 'B', 'c' };
var expectedDestination = new char[3] { 'A', 'B', 'C' };
Expand Down Expand Up @@ -5558,7 +5559,7 @@ public static void Test_ToUpper_Culture(string actual, string expected, CultureI
[Theory]
[InlineData("")]
[InlineData("hello")]
public static void ToString(string s)
public static void ToString_Test(string s)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed because it creates an overload of object.ToString(). Suppress?

{
Assert.Same(s, s.ToString());
Assert.Same(s, s.ToString(null));
Expand Down Expand Up @@ -7203,17 +7204,17 @@ public static unsafe void Ctor_SByte_InvalidArguments()
[Fact]
public static unsafe void Ctor_SByte_NullPointer_ReturnsEmptyString()
{
Assert.Equal(string.Empty, new string((sbyte*) null));
Assert.Equal(string.Empty, new string((sbyte*)null));

Assert.Equal(string.Empty, new string((char*) null, 0, 0));
Assert.Equal(string.Empty, new string((char*)null, 0, 0));

Assert.Equal(string.Empty, new string((sbyte*) null, 0, 0));
Assert.Equal(string.Empty, new string((sbyte*)null, 0, 0));

Assert.Equal(string.Empty, new string((sbyte*) null, 0, 0, Encoding.Default));
Assert.Equal(string.Empty, new string((sbyte*) null, 1, 0, Encoding.Default));
Assert.Equal(string.Empty, new string((sbyte*)null, 0, 0, Encoding.Default));
Assert.Equal(string.Empty, new string((sbyte*)null, 1, 0, Encoding.Default));

Assert.Equal(string.Empty, new string((sbyte*) null, 0, 0, null));
Assert.Equal(string.Empty, new string((sbyte*) null, 1, 0, null));
Assert.Equal(string.Empty, new string((sbyte*)null, 0, 0, null));
Assert.Equal(string.Empty, new string((sbyte*)null, 1, 0, null));
}

[Fact]
Expand All @@ -7232,7 +7233,7 @@ private sealed class AsciiEncodingWithZeroReturningGetCharCount : ASCIIEncoding
public static unsafe void CloneTest()
{
string s = "some string to clone";
string cloned = (string) s.Clone();
string cloned = (string)s.Clone();
Assert.Equal(s, cloned);
Assert.True(object.ReferenceEquals(s, cloned), "cloned object should return same instance of the string");
}
Expand Down Expand Up @@ -7293,7 +7294,7 @@ public static void InternalTestAotSubset()
// U+0301 COMBINING ACUTE ACCENT
// U+0327 COMBINING CEDILLA
// U+00BE VULGAR FRACTION THREE QUARTERS
string s = new string( new char[] {'\u0063', '\u0301', '\u0327', '\u00BE'});
string s = new string(new char[] { '\u0063', '\u0301', '\u0327', '\u00BE' });

Assert.False(s.IsNormalized(), "String should be not normalized when checking with the default which same as FormC");
Assert.False(s.IsNormalized(NormalizationForm.FormC), "String should be not normalized when checking with FormC");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void ArrayBufferWriter_Ctor()

{
ArrayBufferWriter<T> output = default;
Assert.Equal(null, output);
Assert.Null(output);
}
}

Expand Down Expand Up @@ -155,7 +155,7 @@ public void GetSpan_DefaultCtor()

[Theory]
[MemberData(nameof(SizeHints))]
public void GetSpan_DefaultCtor(int sizeHint)
public void GetSpan_DefaultCtor_WithSizeHint(int sizeHint)
{
var output = new ArrayBufferWriter<T>();
Span<T> span = output.GetSpan(sizeHint);
Expand All @@ -172,7 +172,7 @@ public void GetSpan_InitSizeCtor()

[Theory]
[MemberData(nameof(SizeHints))]
public void GetSpan_InitSizeCtor(int sizeHint)
public void GetSpan_InitSizeCtor_WithSizeHint(int sizeHint)
{
{
var output = new ArrayBufferWriter<T>(256);
Expand All @@ -197,7 +197,7 @@ public void GetMemory_DefaultCtor()

[Theory]
[MemberData(nameof(SizeHints))]
public void GetMemory_DefaultCtor(int sizeHint)
public void GetMemory_DefaultCtor_WithSizeHint(int sizeHint)
{
var output = new ArrayBufferWriter<T>();
Memory<T> memory = output.GetMemory(sizeHint);
Expand All @@ -214,7 +214,7 @@ public void GetMemory_InitSizeCtor()

[Theory]
[MemberData(nameof(SizeHints))]
public void GetMemory_InitSizeCtor(int sizeHint)
public void GetMemory_InitSizeCtor_WithSizeHint(int sizeHint)
{
{
var output = new ArrayBufferWriter<T>(256);
Expand Down
2 changes: 1 addition & 1 deletion src/System.Memory/tests/Base64/Base64TestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static byte[] InvalidBytes
get
{
int[] indices = s_decodingMap.FindAllIndexOf(s_invalidByte);
// Workaroudn for indices.Cast<byte>().ToArray() since it throws
// Workaround for indices.Cast<byte>().ToArray() since it throws
// InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.Byte'
byte[] bytes = new byte[indices.Length];
for (int i = 0; i < indices.Length; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/System.Memory/tests/Memory/ImplicitConversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static void Cast<T>(Memory<T> memory, params T[] expected) where T : str
memory.Validate(expected);
}

private static void CastReference<T>(Memory<T> memory, params T[] expected)
private static void CastReference<T>(Memory<T> memory, params T[] expected) where T : class
{
memory.ValidateReferenceType(expected);
}
Expand All @@ -136,7 +136,7 @@ private static void CastReadOnly<T>(ReadOnlyMemory<T> memory, params T[] expecte
memory.Validate(expected);
}

private static void CastReadOnlyReference<T>(ReadOnlyMemory<T> memory, params T[] expected)
private static void CastReadOnlyReference<T>(ReadOnlyMemory<T> memory, params T[] expected) where T : class
{
memory.ValidateReferenceType(expected);
}
Expand Down
4 changes: 2 additions & 2 deletions src/System.Memory/tests/Memory/ToArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public static void ToArrayEmpty()
{
Memory<int> memory = Memory<int>.Empty;
int[] copy = memory.ToArray();
Assert.Equal(0, copy.Length);
Assert.Empty(copy);
}

[Fact]
public static void ToArrayDefault()
{
Memory<int> memory = default;
int[] copy = memory.ToArray();
Assert.Equal(0, copy.Length);
Assert.Empty(copy);
}
}
}
8 changes: 8 additions & 0 deletions src/System.Memory/tests/Memory/Trim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public static void MemoryExtensions_Trim_Single(int[] values, int trim, int[] ex
[InlineData(new int[0], new int[0], new int[0])]
[InlineData(new int[0], new int[] { 1 }, new int[0])]
[InlineData(new int[] { 1 }, new int[0], new int[] { 1 })]
#pragma warning disable xUnit1025 // InlineData duplicates
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an analyser bug unless I can't see properly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the same suppressions are for the same reason.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 I didn't see a duplicate of this; consider filing an issue

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing issue, left a comment there: xunit/xunit#1877

[InlineData(new int[] { 1 }, new int[] { 1 }, new int[0])]
#pragma warning restore xUnit1025 // InlineData duplicates
[InlineData(new int[] { 2 }, new int[] { 1 }, new int[] { 2 })]
[InlineData(new int[] { 1, 2, 1 }, new int[] { 1 }, new int[] { 2, 1 })]
[InlineData(new int[] { 1, 1, 2, 1 }, new int[] { 1 }, new int[] { 2, 1 })]
Expand Down Expand Up @@ -120,7 +122,9 @@ public static void MemoryExtensions_TrimStart_Multi(int[] values, int[] trims, i
[InlineData(new int[0], new int[0], new int[0])]
[InlineData(new int[0], new int[] { 1 }, new int[0])]
[InlineData(new int[] { 1 }, new int[0], new int[] { 1 })]
#pragma warning disable xUnit1025 // InlineData duplicates
[InlineData(new int[] { 1 }, new int[] { 1 }, new int[0])]
#pragma warning restore xUnit1025 // InlineData duplicates
[InlineData(new int[] { 2 }, new int[] { 1 }, new int[] { 2 })]
[InlineData(new int[] { 1, 2, 1 }, new int[] { 1 }, new int[] { 1, 2 })]
[InlineData(new int[] { 1, 2, 1, 1 }, new int[] { 1 }, new int[] { 1, 2 })]
Expand Down Expand Up @@ -150,13 +154,17 @@ public static void MemoryExtensions_TrimEnd_Multi(int[] values, int[] trims, int
[InlineData(new int[0], new int[0], new int[0])]
[InlineData(new int[0], new int[] { 1 }, new int[0])]
[InlineData(new int[] { 1 }, new int[0], new int[] { 1 })]
#pragma warning disable xUnit1025 // InlineData duplicates
[InlineData(new int[] { 1 }, new int[] { 1 }, new int[0])]
#pragma warning restore xUnit1025 // InlineData duplicates
[InlineData(new int[] { 2 }, new int[] { 1 }, new int[] { 2 })]
[InlineData(new int[] { 1, 2, 1 }, new int[] { 1 }, new int[] { 2 })]
[InlineData(new int[] { 1, 2, 1, 1 }, new int[] { 1 }, new int[] { 2 })]
[InlineData(new int[] { 1, 2, 1, 1 }, new int[] { 2 }, new int[] { 1, 2, 1, 1 })]
[InlineData(new int[] { 1, 2, 1, 1 }, new int[] { 3 }, new int[] { 1, 2, 1, 1 })]
#pragma warning disable xUnit1025 // InlineData duplicates
[InlineData(new int[] { 1, 2, 1, 1 }, new int[] { 1, 2 }, new int[0])]
#pragma warning restore xUnit1025 // InlineData duplicates
[InlineData(new int[] { 2, 1, 3, 2, 1, 1 }, new int[] { 1, 2 }, new int[] { 3 })]
[InlineData(new int[] { 2, 1, 3, 2, 1, 1 }, new int[] { 1, 2, 4 }, new int[] { 3 })]
[InlineData(new int[] { 1, 2, 1, 1, 1 }, new int[] { 1 }, new int[] { 2 })]
Expand Down
6 changes: 3 additions & 3 deletions src/System.Memory/tests/MemoryMarshal/AsMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public static IEnumerable<object[]> ReadOnlyMemoryCharInstances()

[Theory]
[MemberData(nameof(ReadOnlyMemoryInt32Instances))]
public static void AsMemory_Roundtrips(ReadOnlyMemory<int> readOnlyMemory) => AsMemory_Roundtrips_Core(readOnlyMemory, true);
public static void AsMemory_Roundtrips_Int32(ReadOnlyMemory<int> readOnlyMemory) => AsMemory_Roundtrips_Core(readOnlyMemory, true);

[Theory]
[MemberData(nameof(ReadOnlyMemoryObjectInstances))]
public static void AsMemory_Roundtrips(ReadOnlyMemory<object> readOnlyMemory) => AsMemory_Roundtrips_Core(readOnlyMemory, false);
public static void AsMemory_Roundtrips_Object(ReadOnlyMemory<object> readOnlyMemory) => AsMemory_Roundtrips_Core(readOnlyMemory, false);

[Theory]
[MemberData(nameof(ReadOnlyMemoryCharInstances))]
public static void AsMemory_Roundtrips(ReadOnlyMemory<char> readOnlyMemory)
public static void AsMemory_Roundtrips_Char(ReadOnlyMemory<char> readOnlyMemory)
{
AsMemory_Roundtrips_Core(readOnlyMemory, true);

Expand Down
2 changes: 1 addition & 1 deletion src/System.Memory/tests/MemoryMarshal/AsReadOnlyRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static void AsReadOnlyRef()
ReadOnlySpan<byte> span = new byte[] { 0x11, 0x22, 0x22, 0x11 };
ref readonly int asInt = ref MemoryMarshal.AsRef<int>(span);

Assert.Equal(asInt, 0x11222211);
Assert.Equal(0x11222211, asInt);
Assert.True(Unsafe.AreSame<byte>(ref Unsafe.As<int, byte>(ref Unsafe.AsRef(in asInt)), ref MemoryMarshal.GetReference(span)));

var array = new byte[100];
Expand Down
2 changes: 1 addition & 1 deletion src/System.Memory/tests/MemoryMarshal/AsRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static void AsRef()
Span<byte> span = new byte[] { 0x11, 0x22, 0x22, 0x11 };
ref int asInt = ref MemoryMarshal.AsRef<int>(span);

Assert.Equal(asInt, 0x11222211);
Assert.Equal(0x11222211, asInt);
Assert.True(Unsafe.AreSame<byte>(ref Unsafe.As<int, byte>(ref asInt), ref MemoryMarshal.GetReference(span)));

var array = new byte[100];
Expand Down
4 changes: 2 additions & 2 deletions src/System.Memory/tests/MemoryMarshal/ToEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ public static void ToEnumerableEmpty()
{
Memory<int> memory = Memory<int>.Empty;
IEnumerable<int> copy = MemoryMarshal.ToEnumerable<int>(memory);
Assert.Equal(0, copy.Count());
Assert.Empty(copy);
}

[Fact]
public static void ToEnumerableDefault()
{
Memory<int> memory = default;
IEnumerable<int> copy = MemoryMarshal.ToEnumerable<int>(memory);
Assert.Equal(0, copy.Count());
Assert.Empty(copy);
}

[Fact]
Expand Down
Loading