Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTarek Mahmoud Sayed <tarekms@microsoft.com>2018-03-09 00:56:43 +0300
committerGitHub <noreply@github.com>2018-03-09 00:56:43 +0300
commit8ad2b10cff945e4428520c6932e8de499af2931b (patch)
treee64ed486443af02ce979036382c4dd23117c158e /src/System.Memory/tests/Base64
parent8b0d0f03f9ed6bd5c4be79af6105372d119e58c8 (diff)
Collapse AsSpan().Slice(...) into .AsSpan(...) (#27867)
Diffstat (limited to 'src/System.Memory/tests/Base64')
-rw-r--r--src/System.Memory/tests/Base64/Base64DecoderUnitTests.cs2
-rw-r--r--src/System.Memory/tests/Base64/Base64EncoderUnitTests.cs6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/System.Memory/tests/Base64/Base64DecoderUnitTests.cs b/src/System.Memory/tests/Base64/Base64DecoderUnitTests.cs
index 15a6733060..3c159ddee4 100644
--- a/src/System.Memory/tests/Base64/Base64DecoderUnitTests.cs
+++ b/src/System.Memory/tests/Base64/Base64DecoderUnitTests.cs
@@ -410,7 +410,7 @@ namespace System.Buffers.Text.Tests
for (int value = 0; value < 256; value++)
{
- Span<byte> sourceBytes = testBytes.AsSpan().Slice(0, value + 1);
+ Span<byte> sourceBytes = testBytes.AsSpan(0, value + 1);
Span<byte> buffer = new byte[Base64.GetMaxEncodedToUtf8Length(sourceBytes.Length)];
Assert.Equal(OperationStatus.Done, Base64.EncodeToUtf8(sourceBytes, buffer, out int consumed, out int written));
diff --git a/src/System.Memory/tests/Base64/Base64EncoderUnitTests.cs b/src/System.Memory/tests/Base64/Base64EncoderUnitTests.cs
index dac8530996..1628f17257 100644
--- a/src/System.Memory/tests/Base64/Base64EncoderUnitTests.cs
+++ b/src/System.Memory/tests/Base64/Base64EncoderUnitTests.cs
@@ -21,7 +21,7 @@ namespace System.Buffers.Text.Tests
for (int value = 0; value < 256; value++)
{
- Span<byte> sourceBytes = bytes.AsSpan().Slice(0, value + 1);
+ Span<byte> sourceBytes = bytes.AsSpan(0, value + 1);
Span<byte> encodedBytes = new byte[Base64.GetMaxEncodedToUtf8Length(sourceBytes.Length)];
Assert.Equal(OperationStatus.Done, Base64.EncodeToUtf8(sourceBytes, encodedBytes, out int consumed, out int encodedBytesCount));
Assert.Equal(sourceBytes.Length, consumed);
@@ -90,7 +90,7 @@ namespace System.Buffers.Text.Tests
// 1610612734, larger than MaximumEncodeLength, requires output buffer of size 2147483648 (which is > int.MaxValue)
const int sourceCount = (int.MaxValue >> 2) * 3 + 1;
const int encodedCount = 2000000000;
-
+
try
{
allocatedFirst = AllocationHelper.TryAllocNative((IntPtr)sourceCount, out memBlockFirst);
@@ -103,7 +103,7 @@ namespace System.Buffers.Text.Tests
var encodedBytes = new Span<byte>(memBlockSecond.ToPointer(), encodedCount);
Assert.Equal(OperationStatus.DestinationTooSmall, Base64.EncodeToUtf8(source, encodedBytes, out int consumed, out int encodedBytesCount));
- Assert.Equal((encodedBytes.Length >> 2) * 3, consumed); // encoding 1500000000 bytes fits into buffer of 2000000000 bytes
+ Assert.Equal((encodedBytes.Length >> 2) * 3, consumed); // encoding 1500000000 bytes fits into buffer of 2000000000 bytes
Assert.Equal(encodedBytes.Length, encodedBytesCount);
}
}