Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
d464af7
[xunit tests][mono] Remove disabled Microsoft.VisualBasic.Core.Tests …
MaximLipnin Jan 23, 2020
de634c5
[xunit tests][mono] Remove System.Collections.Specialized.Tests.Ctor_…
MaximLipnin Jan 23, 2020
d1d6386
Remove System.Collections.Concurrent.Tests.ConcurrentQueueTests.Refer…
MaximLipnin Jan 23, 2020
62a31f4
Remove BasicEventSourceTests.TestsManifestNegative.Test_GenerateManif…
MaximLipnin Jan 23, 2020
1b21ae4
Remove ManagedTests.DynamicCSharp.Conformance.dynamic.overloadResolut…
MaximLipnin Jan 23, 2020
f63488b
Remove System.IO.Tests.*.CopyFileWithData_MemberData from rsp file
MaximLipnin Jan 23, 2020
5c9e2c2
Move a set of skipped System.Linq.Expressions.Tests out of rsp file.
MaximLipnin Jan 23, 2020
8b7f4a7
Annotate System.Collections.Concurrent.Tests.ConcurrentQueueTests.Ref…
MaximLipnin Jan 24, 2020
870a16a
Move another set of skipped System.Linq.Expressions.Tests out of rsp …
MaximLipnin Jan 24, 2020
fa9dfb5
Move skipped System.Linq.Parallel.Tests.PlinqModesTests.WithExecution…
MaximLipnin Jan 24, 2020
9c6144d
Move skipped System.Memory.Tests out of rsp file
MaximLipnin Jan 24, 2020
43f57d8
Move skipped System.Net.Http.Functional.Tests.PlatformHandler_HttpCli…
MaximLipnin Jan 24, 2020
46cc919
Remove System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterfa…
MaximLipnin Jan 24, 2020
310b879
Move System.Reflection tests with an active issue out of rsp file
MaximLipnin Jan 24, 2020
81f97fc
Move skipped System.Runtime.InteropServices.Tests out of rsp file
MaximLipnin Jan 24, 2020
b705010
Replace closed CoreFX GH issue with the active Runtime one
MaximLipnin Jan 24, 2020
f444ffb
Move skipped System.Runtime.Serialization.Formatters.Tests out of rsp…
MaximLipnin Jan 24, 2020
3311ccc
Move skipped System.Runtime.Tests with an active issue out of rsp file
MaximLipnin Jan 24, 2020
d911dad
Move skipped System.Threading.Tests with an active issue out of rsp file
MaximLipnin Jan 27, 2020
b278278
Remove skipped System.Data.Common.Tests because the related issue was…
MaximLipnin Jan 27, 2020
3aa460e
Move skipped System.Data.Common.Tests.DbConnectionTests.ProviderFacto…
MaximLipnin Jan 27, 2020
e1a4e85
Move skipped System.Diagnostics.StackTrace.Tests with an active issue…
MaximLipnin Jan 27, 2020
920d42d
Move skipped System.Numerics.Vectors.Tests with an active issue out o…
MaximLipnin Jan 27, 2020
07722f1
Move skipped System.Reflection.Context.Tests with an active issue out…
MaximLipnin Jan 27, 2020
5d3788e
Move skipped System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMi…
MaximLipnin Jan 27, 2020
288b12d
Move skipped System.ComponentModel.Composition and Tests.Integration …
MaximLipnin Jan 28, 2020
e146c57
Update a message in skipped System.Runtime.InteropServices.Tests
MaximLipnin Jan 28, 2020
d9cd430
Move skipped System.Reflection.Tests.MetadataTokenTests.SuccessImplie…
MaximLipnin Jan 28, 2020
fd2b05f
Move skipped/no repro System.Threading.Overlapped.Tests with an activ…
MaximLipnin Jan 28, 2020
d0c9bd7
Move skipped System.Runtime.Extensions with an active issue out of rs…
MaximLipnin Jan 28, 2020
a0c84bf
Re-enable skipped System.Runtime.Handles.Tests because the related is…
MaximLipnin Jan 28, 2020
8612c52
Move skipped System.Reflection.TypeExtensions.Tests with an active is…
MaximLipnin Jan 28, 2020
bab4de6
Move skipped System.Reflection.Emit.Lightweight.Tests with an active …
MaximLipnin Jan 28, 2020
90e0f05
Move skipped System.Reflection.MetadataLoadContext.Tests with an acti…
MaximLipnin Jan 28, 2020
8fc9fc8
Move skipped System.Xml.Xsl.XslTransformApi.Tests with an active issu…
MaximLipnin Jan 28, 2020
fc5784f
Move skipped System.Security.Cryptography.Encoding.Tests with an acti…
MaximLipnin Jan 28, 2020
3d0e18f
Move System.Drawing.Imaging.Tests.ImageAttributesTests.SetColorMatrix…
MaximLipnin Jan 29, 2020
110dd50
Add an active issue attribute to System.Drawing.Imaging.Tests.ImageAt…
MaximLipnin Jan 29, 2020
9c845ef
Move System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHa…
MaximLipnin Jan 29, 2020
5b9f525
Remove System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClient…
MaximLipnin Jan 29, 2020
798166e
Move skipped System.Reflection.Emit.ILGeneration.Tests with an active…
MaximLipnin Jan 30, 2020
5bb95df
Move skipped System.Reflection.Emit.Tests with an active issue out of…
MaximLipnin Jan 30, 2020
fd36223
Remove skipped System.Reflection.Tests from rsp file because they pas…
MaximLipnin Jan 31, 2020
30b1399
Try to re-enabled skipped System.Reflection.Tests.AssemblyTests.LoadF…
MaximLipnin Jan 31, 2020
991973d
Remove broken namespace
MaximLipnin Jan 31, 2020
daa2f60
Add an active issue to System.Reflection.Tests.AssemblyTests.LoadFrom…
MaximLipnin Jan 31, 2020
542826b
Add an active issue to several System.Reflection tests
MaximLipnin Feb 3, 2020
0d3519b
Remove skipped System.Tests.ExitCodeTests.SigTermExitCode because it …
MaximLipnin Feb 3, 2020
eb8e367
Remove skipped System.Tests.Types.VoidTests.IsByRef_Get_ReturnsExpect…
MaximLipnin Feb 3, 2020
3838bca
Remove skipped System.Tests.GCTests.LatencyRoundtrips from rsp file b…
MaximLipnin Feb 3, 2020
4fd0db2
Remove skipped System.Tests.GCExtendedTests.GetGCMemoryInfo from rsp-…
MaximLipnin Feb 3, 2020
bb40fb8
Remove skipped System.Tests.GetEnvironmentVariable.EnvironmentVariabl…
MaximLipnin Feb 3, 2020
ce32cbc
Turn System.Threading.Tasks.Tests.ExecutionContextFlowTest.TaskComple…
MaximLipnin Feb 3, 2020
f5127c0
Try to re-enable System.Threading.Tasks.Tests.TaskContinueWithTests.L…
MaximLipnin Feb 3, 2020
3a17e8f
Remove skipped System.Threading.ThreadPools.Tests.ThreadPoolTests.Set…
MaximLipnin Feb 3, 2020
380a707
Remove System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMinMaxTh…
MaximLipnin Feb 3, 2020
92efedc
Add an active issue to System.Tests.ExitCodeTests.SigTermExitCode and…
MaximLipnin Feb 3, 2020
9edaa39
Remove skipped System.Data.Tests.SqlTypes.SqlCharsTest.ReadWriteXmlTe…
MaximLipnin Feb 3, 2020
adc7259
Add an active issue to System.Tests.GCExtendedTests.GetGCMemoryInfo b…
MaximLipnin Feb 3, 2020
9919b2a
Add an active issue
MaximLipnin Feb 4, 2020
cc07bdf
Add an active issue
MaximLipnin Feb 4, 2020
938ae1e
Re-add an active issue to System.Tests.ExceptionTests.ThrowStatementD…
MaximLipnin Feb 5, 2020
c58858f
Move skipped System.ComponentModel.Composition.MetadataViewProviderTe…
MaximLipnin Feb 5, 2020
239a4fe
Remove skipped Tests.Integration.ExportFactoryTests.ExportFactoryStan…
MaximLipnin Feb 5, 2020
6dbe861
Remove several skipped System.ComponentModel.Composition.Tests from r…
MaximLipnin Feb 5, 2020
1d3c353
Move skipped System.ComponentModel.Composition.ExportCollectionTests.…
MaximLipnin Feb 5, 2020
5a03664
Move skipped System.Diagnostics.Tests.StackTraceTests.Ctor_Exception_…
MaximLipnin Feb 5, 2020
4e11c67
Move skipped System.Diagnostics.Tests.StackTraceTests.ToString_Invoke…
MaximLipnin Feb 5, 2020
49fa1e9
Remove skipped System.Reflection.Tests.MetadataLoadContextTests.Reloc…
MaximLipnin Feb 5, 2020
b8b2796
Move skipped System.Runtime.Loader.Tests.RefEmitLoadContextTests.Load…
MaximLipnin Feb 5, 2020
50990eb
Moved skipped ThreadPoolBoundHandleTests.PreAllocatedOverlapped_NullA…
MaximLipnin Feb 5, 2020
7e33476
Move skipped System.Runtime.Tests.ProfileOptimizationTest.ProfileOpti…
MaximLipnin Feb 6, 2020
69c299e
Move skipped System.Reflection.Emit.Tests.DynamicILInfoTests with an …
MaximLipnin Feb 6, 2020
23b2e97
Move skipped System.Reflection.Emit.Tests.DynamicILInfoTests.SetX_Nul…
MaximLipnin Feb 6, 2020
7c50f19
Add an active issue to System.Threading.Tasks.Tests.TaskContinueWithT…
MaximLipnin Feb 7, 2020
1e43fdb
Add an active issue to Tests.Integration.DiscoveryTests.DiscoverAddin…
MaximLipnin Feb 8, 2020
55fb2fe
Add an active issue to System.Threading.ThreadPools.Tests.ThreadPoolT…
MaximLipnin Feb 10, 2020
6d62ffb
Add an active issue to System.ComponentModel.Composition.MetadataAttr…
MaximLipnin Feb 10, 2020
20395ca
Replace TargetFrameworkMonikers.Mono with TestRuntimes.Mono
MaximLipnin Feb 13, 2020
001dbeb
Remove redundant space
MaximLipnin Feb 14, 2020
6a5a07a
Remove all -notrait category
MaximLipnin Feb 14, 2020
b7aa5d3
Add an active issue to System.ComponentModel.Composition.MetadataAttr…
MaximLipnin Feb 14, 2020
3b74374
Add an active issue to System.ComponentModel.Composition.CompositionC…
MaximLipnin Feb 14, 2020
5514c90
Disable the whole System.ComponentModel.Composition.Tests namespace
MaximLipnin Feb 15, 2020
05fe86d
Move some System.Runtime.Loader.Tests, which rely on collectible Asse…
MaximLipnin Feb 17, 2020
07afeb2
Remove three System.Runtime.Loader.Tests.AssemblyLoadContextTest test…
MaximLipnin Feb 17, 2020
6a0d104
Remove System.Runtime.Loader.Tests.DefaultLoadContextTests.LoadNonExi…
MaximLipnin Feb 17, 2020
3ce15ea
Add an active issue to System.Runtime.Loader.Tests.DefaultLoadContext…
MaximLipnin Feb 17, 2020
7779a6b
Move several System.Runtime.Loader.Tests.AssemblyLoadContextTest with…
MaximLipnin Feb 17, 2020
315a4c8
Remove System.Utf8String.Experimental.Tests from rsp file to verify h…
MaximLipnin Feb 18, 2020
16a55ef
Clean up rsp file to check all remaining failures
MaximLipnin Feb 18, 2020
4e28d11
Skip the entire System.ComponentModel.Composition.Registration.Tests …
MaximLipnin Feb 18, 2020
0d3f163
Disable a set of classes in System.Utf8String.Experimental.Tests work…
MaximLipnin Feb 18, 2020
5172b49
Add stubs for Utf8String and Utf8Span.cs classes to fix the test buil…
MaximLipnin Feb 18, 2020
7d0bbc6
Remove nint/nunit aliases unused in PNSE version of Utf8Span
MaximLipnin Feb 18, 2020
19a5e04
Remove CoreFX.issues.rsp file because it has been cleaned up
MaximLipnin Feb 18, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace System.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public unsafe partial class Char8Tests
{
[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace System.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public partial class MemoryTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace System.Net.Http.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public partial class Utf8StringContentTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace System.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public partial class ReflectionTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace System.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public partial class Utf8ExtensionsTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

namespace System.Text.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public unsafe partial class Utf8SpanTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace System.Tests
{
[SkipOnMono("The features from System.Utf8String.Experimental namespace are experimental.")]
public unsafe partial class Utf8StringTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
<Compile Include="$(BclSourcesRoot)\System\TypedReference.cs" />
<Compile Include="$(BclSourcesRoot)\System\TypeLoadException.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\TypeNameParser.cs" />
<Compile Include="$(BclSourcesRoot)\System\Utf8String.cs" />
<Compile Include="$(BclSourcesRoot)\System\ValueType.cs" />
<Compile Include="$(BclSourcesRoot)\System\WeakReference.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\WeakReference.T.Mono.cs" />
Expand Down Expand Up @@ -252,6 +253,7 @@
<Compile Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\Remoting\Contexts\Context.cs" />
<Compile Include="$(BclSourcesRoot)\System\Security\DynamicSecurityMethodAttribute.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\Utf8Span.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Interlocked.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Monitor.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\Overlapped.cs" />
Expand Down
118 changes: 118 additions & 0 deletions src/mono/netcore/System.Private.CoreLib/src/System/Text/Utf8Span.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Buffers;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text.Unicode;
using Internal.Runtime.CompilerServices;

#pragma warning disable 0809 //warning CS0809: Obsolete member 'Utf8Span.Equals(object)' overrides non-obsolete member 'object.Equals(object)'

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if TARGET_64BIT
using nint = System.Int64;
using nuint = System.UInt64;
#else
using nint = System.Int32;
using nuint = System.UInt32;
#endif
Comment thread
akoeplinger marked this conversation as resolved.
Outdated

namespace System.Text
{
[StructLayout(LayoutKind.Auto)]
public readonly ref partial struct Utf8Span
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Utf8Span(Utf8String? value)
{
throw new PlatformNotSupportedException();
}

public ReadOnlySpan<byte> Bytes { get; }

public static Utf8Span Empty => default;

public bool IsEmpty => throw new PlatformNotSupportedException();

public int Length => throw new PlatformNotSupportedException();

public Utf8Span this[Range range]
{
get
{
throw new PlatformNotSupportedException();
}
}

public bool IsEmptyOrWhiteSpace() => throw new PlatformNotSupportedException();

[Obsolete("Equals(object) on Utf8Span will always throw an exception. Use Equals(Utf8Span) or operator == instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object? obj)
{
throw new NotSupportedException(SR.Utf8Span_CannotCallEqualsObject);
}

public bool Equals(Utf8Span other) => throw new PlatformNotSupportedException();

public bool Equals(Utf8Span other, StringComparison comparison) => throw new PlatformNotSupportedException();

public static bool Equals(Utf8Span left, Utf8Span right) => throw new PlatformNotSupportedException();

public static bool Equals(Utf8Span left, Utf8Span right, StringComparison comparison)
{
throw new PlatformNotSupportedException();
}

public override int GetHashCode()
{
throw new PlatformNotSupportedException();
}

public int GetHashCode(StringComparison comparison)
{
throw new PlatformNotSupportedException();
}

public bool IsAscii()
{
throw new PlatformNotSupportedException();
}

public bool IsNormalized(NormalizationForm normalizationForm = NormalizationForm.FormC)
{
throw new PlatformNotSupportedException();
}

[EditorBrowsable(EditorBrowsableState.Never)]
public ref readonly byte GetPinnableReference()
{
throw new PlatformNotSupportedException();
}

public override string ToString()
{
throw new PlatformNotSupportedException();
}

internal unsafe string ToStringNoReplacement()
{
throw new PlatformNotSupportedException();
}

public Utf8String ToUtf8String()
{
throw new PlatformNotSupportedException();
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Utf8Span UnsafeCreateWithoutValidation(ReadOnlySpan<byte> buffer)
{
throw new PlatformNotSupportedException();
}
}
}
112 changes: 112 additions & 0 deletions src/mono/netcore/System.Private.CoreLib/src/System/Utf8String.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Buffers;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.Unicode;
using Internal.Runtime.CompilerServices;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if TARGET_64BIT
using nint = System.Int64;
using nuint = System.UInt64;
#else
using nint = System.Int32;
using nuint = System.UInt32;
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nint/nuint isn't used, can be removed.


namespace System
{
/// <summary>
/// Represents an immutable string of UTF-8 code units.
/// </summary>
public sealed partial class Utf8String : IComparable<Utf8String?>, IEquatable<Utf8String?>
{
public static readonly Utf8String Empty;
public static bool operator ==(Utf8String? left, Utf8String? right) => throw new PlatformNotSupportedException();
public static bool operator !=(Utf8String? left, Utf8String? right) => throw new PlatformNotSupportedException();
public static implicit operator Utf8Span(Utf8String? value) => throw new PlatformNotSupportedException();

public int Length => throw new PlatformNotSupportedException();
public Utf8String this[Range range]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
throw new PlatformNotSupportedException();
}
}

public int CompareTo(Utf8String? other)
{
throw new PlatformNotSupportedException();
}

public int CompareTo(Utf8String? other, StringComparison comparison)
{
throw new PlatformNotSupportedException();
}

public override bool Equals(object? obj)
{
throw new PlatformNotSupportedException();
}

public bool Equals(Utf8String? value)
{
throw new PlatformNotSupportedException();
}

public bool Equals(Utf8String? value, StringComparison comparison) => throw new PlatformNotSupportedException();

public static bool Equals(Utf8String? left, Utf8String? right)
{
throw new PlatformNotSupportedException();
}

public static bool Equals(Utf8String? a, Utf8String? b, StringComparison comparison)
{
throw new PlatformNotSupportedException();
}

public override int GetHashCode()
{
throw new PlatformNotSupportedException();
}

public int GetHashCode(StringComparison comparison)
{
throw new PlatformNotSupportedException();
}

[EditorBrowsable(EditorBrowsableState.Never)] // for compiler use only
public ref readonly byte GetPinnableReference() => throw new PlatformNotSupportedException();

public bool IsAscii()
{
throw new PlatformNotSupportedException();
}

public static bool IsNullOrEmpty([NotNullWhen(false)] Utf8String? value)
{
throw new PlatformNotSupportedException();
}

public static bool IsNullOrWhiteSpace([NotNullWhen(false)] Utf8String? value)
{
throw new PlatformNotSupportedException();
}

public byte[] ToByteArray() => throw new PlatformNotSupportedException();

public override string ToString()
{
throw new PlatformNotSupportedException();
}
}
}