Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/libraries/System.Private.CoreLib/src/System/Double.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ static double IParseable<double>.Parse(string s, IFormatProvider? provider)

[RequiresPreviewFeatures]
static bool IParseable<double>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out double result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISignedNumber
Expand All @@ -1256,11 +1256,11 @@ static bool IParseable<double>.TryParse([NotNullWhen(true)] string? s, IFormatPr

[RequiresPreviewFeatures]
static double ISpanParseable<double>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
=> Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);

[RequiresPreviewFeatures]
static bool ISpanParseable<double>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out double result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISubtractionOperators
Expand Down
10 changes: 5 additions & 5 deletions src/libraries/System.Private.CoreLib/src/System/Half.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static bool IsSubnormal(Half value)
public static Half Parse(string s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseHalf(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.CurrentInfo);
return Number.ParseHalf(s, DefaultParseStyle, NumberFormatInfo.CurrentInfo);
}

/// <summary>
Expand All @@ -266,7 +266,7 @@ public static Half Parse(string s, NumberStyles style)
public static Half Parse(string s, IFormatProvider? provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseHalf(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider));
return Number.ParseHalf(s, DefaultParseStyle, NumberFormatInfo.GetInstance(provider));
}

/// <summary>
Expand Down Expand Up @@ -1554,7 +1554,7 @@ static Half IParseable<Half>.Parse(string s, IFormatProvider? provider)

[RequiresPreviewFeatures]
static bool IParseable<Half>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out Half result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, DefaultParseStyle, provider, out result);

//
// ISignedNumber
Expand All @@ -1569,11 +1569,11 @@ static bool IParseable<Half>.TryParse([NotNullWhen(true)] string? s, IFormatProv

[RequiresPreviewFeatures]
static Half ISpanParseable<Half>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
=> Parse(s, DefaultParseStyle, provider);

[RequiresPreviewFeatures]
static bool ISpanParseable<Half>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Half result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, DefaultParseStyle, provider, out result);

//
// ISubtractionOperators
Expand Down
6 changes: 3 additions & 3 deletions src/libraries/System.Private.CoreLib/src/System/Single.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ static float IParseable<float>.Parse(string s, IFormatProvider? provider)

[RequiresPreviewFeatures]
static bool IParseable<float>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out float result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISignedNumber
Expand All @@ -1248,11 +1248,11 @@ static bool IParseable<float>.TryParse([NotNullWhen(true)] string? s, IFormatPro

[RequiresPreviewFeatures]
static float ISpanParseable<float>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
=> Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);

[RequiresPreviewFeatures]
static bool ISpanParseable<float>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out float result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISubtractionOperators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
<ItemGroup>
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\ByteTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\CharTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\DoubleTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\HalfTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int16Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int32Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int64Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\IntPtrTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\SByteTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\SingleTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt16Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt32Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt64Tests.cs" />
Expand All @@ -29,18 +32,22 @@
<ItemGroup Condition="'$(FeatureGenericMath)' == 'true'">
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\ByteTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\CharTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\DoubleTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\GenericMathHelpers.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\HalfTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int16Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int32Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int64Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\IntPtrTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\SByteTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\SingleTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt16Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt32Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt64Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UIntPtrTests.GenericMath.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Numerics.TestData" Version="$(SystemRuntimeNumericsTestDataVersion)" GeneratePathProperty="true" />
<!-- it's a reference assembly, but the project system doesn't know that - include it during compilation, but don't publish it -->
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj" IncludeAssets="compile" Private="false" />
<ProjectReference Include="$(CommonTestPath)TestUtilities.Unicode\TestUtilities.Unicode.csproj" />
Expand Down
59 changes: 22 additions & 37 deletions src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,19 @@
<DefineConstants Condition="'$(FeatureGenericMath)' == 'true'">$(DefineConstants);FEATURE_GENERIC_MATH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)System\EnumTypes.cs"
Link="Common\System\EnumTypes.cs" />
<Compile Include="$(CommonTestPath)System\MockType.cs"
Link="Common\System\MockType.cs" />
<Compile Include="$(CommonTestPath)System\Collections\CollectionAsserts.cs"
Link="Common\System\Collections\CollectionAsserts.cs" />
<Compile Include="$(CommonTestPath)System\Collections\ICollection.Generic.Tests.cs"
Link="Common\System\Collections\ICollection.Generic.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.Generic.Tests.cs"
Link="Common\System\Collections\IEnumerable.Generic.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IList.Generic.Tests.cs"
Link="Common\System\Collections\IList.Generic.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\TestBase.Generic.cs"
Link="Common\System\Collections\TestBase.Generic.cs" />
<Compile Include="$(CommonTestPath)System\Collections\TestBase.NonGeneric.cs"
Link="Common\System\Collections\TestBase.NonGeneric.cs" />
<Compile Include="$(CommonTestPath)Tests\System\StringTests.cs"
Link="Common\System\StringTests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IDictionary.NonGeneric.Tests.cs"
Link="Common\System\Collections\IDictionary.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IList.NonGeneric.Tests.cs"
Link="Common\System\Collections\IList.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\ICollection.NonGeneric.Tests.cs"
Link="Common\System\Collections\ICollection.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.NonGeneric.Tests.cs"
Link="Common\System\Collections\IEnumerable.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\EnumTypes.cs" Link="Common\System\EnumTypes.cs" />
<Compile Include="$(CommonTestPath)System\MockType.cs" Link="Common\System\MockType.cs" />
<Compile Include="$(CommonTestPath)System\Collections\CollectionAsserts.cs" Link="Common\System\Collections\CollectionAsserts.cs" />
<Compile Include="$(CommonTestPath)System\Collections\ICollection.Generic.Tests.cs" Link="Common\System\Collections\ICollection.Generic.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.Generic.Tests.cs" Link="Common\System\Collections\IEnumerable.Generic.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IList.Generic.Tests.cs" Link="Common\System\Collections\IList.Generic.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\TestBase.Generic.cs" Link="Common\System\Collections\TestBase.Generic.cs" />
<Compile Include="$(CommonTestPath)System\Collections\TestBase.NonGeneric.cs" Link="Common\System\Collections\TestBase.NonGeneric.cs" />
<Compile Include="$(CommonTestPath)Tests\System\StringTests.cs" Link="Common\System\StringTests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IDictionary.NonGeneric.Tests.cs" Link="Common\System\Collections\IDictionary.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IList.NonGeneric.Tests.cs" Link="Common\System\Collections\IList.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\ICollection.NonGeneric.Tests.cs" Link="Common\System\Collections\ICollection.NonGeneric.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.NonGeneric.Tests.cs" Link="Common\System\Collections\IEnumerable.NonGeneric.Tests.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="Microsoft\Win32\SafeHandles\CriticalHandleZeroOrMinusOneIsInvalid.cs" />
<Compile Include="Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs" />
Expand Down Expand Up @@ -248,21 +235,23 @@
<Compile Include="System\Type\TypePropertyTests.cs" />
<Compile Include="System\Type\TypeTests.cs" />
<Compile Include="System\Type\TypeTests.Get.cs" />
<Compile Include="$(CommonTestPath)System\RandomDataGenerator.cs"
Link="Common\System\RandomDataGenerator.cs" />
<Compile Include="$(CommonTestPath)System\RandomDataGenerator.cs" Link="Common\System\RandomDataGenerator.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
<Compile Include="System\ExitCodeTests.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(FeatureGenericMath)' == 'true'">
<Compile Include="System\ByteTests.GenericMath.cs" />
<Compile Include="System\CharTests.GenericMath.cs" />
<Compile Include="System\DoubleTests.GenericMath.cs" />
<Compile Include="System\GenericMathHelpers.cs" />
<Compile Include="System\HalfTests.GenericMath.cs" />
<Compile Include="System\Int16Tests.GenericMath.cs" />
<Compile Include="System\Int32Tests.GenericMath.cs" />
<Compile Include="System\Int64Tests.GenericMath.cs" />
<Compile Include="System\IntPtrTests.GenericMath.cs" />
<Compile Include="System\SByteTests.GenericMath.cs" />
<Compile Include="System\SingleTests.GenericMath.cs" />
<Compile Include="System\UInt16Tests.GenericMath.cs" />
<Compile Include="System\UInt32Tests.GenericMath.cs" />
<Compile Include="System\UInt64Tests.GenericMath.cs" />
Expand All @@ -283,31 +272,27 @@
<Compile Include="System\Text\Unicode\Utf8Tests.cs" />
<Compile Include="System\Text\Unicode\Utf8UtilityTests.ValidateBytes.cs" />
<Compile Include="System\ArgIteratorTests.cs" />
<Compile Include="$(CommonPath)..\tests\System\RealFormatterTestsBase.cs"
Link="System\RealFormatterTestsBase.cs" />
<Compile Include="$(CommonPath)..\tests\System\RealFormatterTestsBase.cs" Link="System\RealFormatterTestsBase.cs" />
<Compile Include="System\RealFormatterTests.cs" />
<Compile Include="$(CommonPath)..\tests\System\RealParserTestsBase.cs"
Link="System\RealParserTestsBase.cs" />
<Compile Include="$(CommonPath)..\tests\System\RealParserTestsBase.cs" Link="System\RealParserTestsBase.cs" />
<Compile Include="System\RealParserTests.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.Generic.Serialization.Tests.cs"
Link="Common\System\Collections\IEnumerable.Generic.Serialization.Tests.cs" />
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.Generic.Serialization.Tests.cs" Link="Common\System\Collections\IEnumerable.Generic.Serialization.Tests.cs" />
<EmbeddedResource Include="System\Reflection\EmbeddedImage.png">
<LogicalName>System.Reflection.Tests.EmbeddedImage.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="System\Reflection\EmbeddedTextFile.txt">
<LogicalName>System.Reflection.Tests.EmbeddedTextFile.txt</LogicalName>
</EmbeddedResource>
<Compile Include="$(CommonTestPath)System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs"
Link="Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs" />
<Compile Include="$(CommonTestPath)System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs" Link="Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="System.Runtime.Numerics.TestData" Version="$(SystemRuntimeNumericsTestDataVersion)" GeneratePathProperty="true"/>
<PackageReference Include="System.Runtime.Numerics.TestData" Version="$(SystemRuntimeNumericsTestDataVersion)" GeneratePathProperty="true" />
<ProjectReference Include="TestLoadAssembly\TestLoadAssembly.csproj" />
<ProjectReference Include="TestCollectibleAssembly\TestCollectibleAssembly.csproj" />
<ProjectReference Include="TestModule\System.Reflection.TestModule.ilproj" />
Expand Down
Loading