Consolidate .netcoreapp.cs test files in System.Runtime.* (#999)
authorRoman Marusyk <Marusyk@users.noreply.github.com>
Thu, 19 Dec 2019 01:16:39 +0000 (03:16 +0200)
committerJan Kotas <jkotas@microsoft.com>
Thu, 19 Dec 2019 01:16:39 +0000 (17:16 -0800)
* Consolidate .netcoreapp.cs files because System.Runtime.* projects is no longer cross-compiled

16 files changed:
src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs
src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.netcoreapp.cs [deleted file]
src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/System.Runtime.InteropServices.RuntimeInformation.Tests.csproj
src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.cs
src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.netcoreapp.cs [deleted file]
src/libraries/System.Runtime.Numerics/tests/BigInteger/ToByteArray.cs
src/libraries/System.Runtime.Numerics/tests/BigInteger/ToByteArray.netcoreapp.cs [deleted file]
src/libraries/System.Runtime.Numerics/tests/BigInteger/ctor.cs
src/libraries/System.Runtime.Numerics/tests/BigInteger/ctor.netcoreapp.cs [deleted file]
src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs
src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.netcoreapp.cs [deleted file]
src/libraries/System.Runtime.Numerics/tests/ComplexTests.cs
src/libraries/System.Runtime.Numerics/tests/ComplexTests.netcoreapp.cs [deleted file]
src/libraries/System.Runtime.Numerics/tests/System.Runtime.Numerics.Tests.csproj
src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj
src/libraries/System.Runtime/tests/System/RealParserTests.cs [moved from src/libraries/System.Runtime/tests/System/RealParserTests.netcoreapp.cs with 100% similarity]

index 877fe39..e94b489 100644 (file)
@@ -7,7 +7,7 @@ using Xunit;
 
 namespace System.Runtime.InteropServices.RuntimeInformationTests
 {
-    public partial class CheckPlatformTests
+    public class CheckPlatformTests
     {
         [Fact, PlatformSpecific(TestPlatforms.Linux)]  // Tests RuntimeInformation OS platform
         public void CheckLinux()
@@ -25,15 +25,16 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("UNIX")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
         }
 
         [Fact, PlatformSpecific(TestPlatforms.NetBSD)]  // Tests RuntimeInformation OS platform
         public void CheckNetBSD()
         {
             Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
+
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
-
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("LINUX")));
@@ -43,6 +44,7 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
         }
 
         [Fact, PlatformSpecific(TestPlatforms.OSX)]  // Tests RuntimeInformation OS platform
@@ -55,12 +57,13 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("mac")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOSX")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
         }
 
         [Fact, PlatformSpecific(TestPlatforms.Windows)]  // Tests RuntimeInformation OS platform
@@ -68,14 +71,33 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
         {
             Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
             Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("WINDOWS")));
+
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("windows")));
             Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("Windows NT")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
+        }
+
+        [Fact, PlatformSpecific(TestPlatforms.FreeBSD)]  // Tests RuntimeInformation OS platform
+        public void CheckFreeBSD()
+        {
+            Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
+            Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
+
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("LINUX")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("linux")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("ubuntu")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("UNIX")));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
+            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
         }
 
         [Fact]
diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.netcoreapp.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.netcoreapp.cs
deleted file mode 100644 (file)
index a780153..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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.Runtime.InteropServices;
-using Xunit;
-
-namespace System.Runtime.InteropServices.RuntimeInformationTests
-{
-    public partial class CheckPlatformTests
-    {
-        [Fact, PlatformSpecific(TestPlatforms.FreeBSD)]
-        public void CheckFreeBSD()
-        {
-            Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
-            Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
-
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("LINUX")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("linux")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("ubuntu")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("UNIX")));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
-        }
-
-        [Fact, PlatformSpecific(~TestPlatforms.FreeBSD)]
-        public void CheckFreeBSDOnOtherPlatforms()
-        {
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
-            Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
-        }
-    }
-}
index 21a0333..fe095f3 100644 (file)
@@ -5,7 +5,6 @@
   <ItemGroup>
     <Compile Include="CheckArchitectureTests.cs" />
     <Compile Include="CheckPlatformTests.cs" />
-    <Compile Include="CheckPlatformTests.netcoreapp.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
     <Compile Include="DescriptionNameTests.cs" />
     <Compile Include="$(CommonPath)Interop\Linux\cgroups\Interop.cgroups.cs">
       <Link>Common\Interop\Linux\Interop.cgroups.cs</Link>
index 2e99d07..3255438 100644 (file)
@@ -11,7 +11,7 @@ using Xunit;
 
 namespace System.Numerics.Tests
 {
-    public partial class ToStringTest
+    public class ToStringTest
     {
         private static bool s_noZeroOut = true;
 
@@ -1460,7 +1460,29 @@ namespace System.Numerics.Tests
             }
         }
 
-        static partial void VerifyTryFormat(string test, string format, IFormatProvider provider, bool expectError, string expectedResult);
+        static void VerifyTryFormat(string test, string format, IFormatProvider provider, bool expectError, string expectedResult)
+        {
+            try
+            {
+                BigInteger bi = BigInteger.Parse(test, provider);
+
+                char[] destination = expectedResult != null ? new char[expectedResult.Length] : Array.Empty<char>();
+                Assert.True(bi.TryFormat(destination, out int charsWritten, format, provider));
+                Assert.False(expectError);
+
+                VerifyExpectedStringResult(expectedResult, new string(destination, 0, charsWritten));
+
+                if (expectedResult.Length > 0)
+                {
+                    Assert.False(bi.TryFormat(new char[expectedResult.Length - 1], out charsWritten, format, provider));
+                    Assert.Equal(0, charsWritten);
+                }
+            }
+            catch (FormatException)
+            {
+                Assert.True(expectError);
+            }
+        }
 
         private static string GetDigitSequence(int min, int max, Random random)
         {
diff --git a/src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.netcoreapp.cs b/src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.netcoreapp.cs
deleted file mode 100644 (file)
index 449f0e3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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 Xunit;
-
-namespace System.Numerics.Tests
-{
-    public partial class ToStringTest
-    {
-        static partial void VerifyTryFormat(string test, string format, IFormatProvider provider, bool expectError, string expectedResult)
-        {
-            try
-            {
-                BigInteger bi = BigInteger.Parse(test, provider);
-
-                char[] destination = expectedResult != null ? new char[expectedResult.Length] : Array.Empty<char>();
-                Assert.True(bi.TryFormat(destination, out int charsWritten, format, provider));
-                Assert.False(expectError);
-
-                VerifyExpectedStringResult(expectedResult, new string(destination, 0, charsWritten));
-
-                if (expectedResult.Length > 0)
-                {
-                    Assert.False(bi.TryFormat(new char[expectedResult.Length - 1], out charsWritten, format, provider));
-                    Assert.Equal(0, charsWritten);
-                }
-            }
-            catch (FormatException)
-            {
-                Assert.True(expectError);
-            }
-        }
-    }
-}
index 0a9c20f..34c784d 100644 (file)
@@ -124,5 +124,114 @@ namespace System.Numerics.Tests
             BigInteger bi2 = new BigInteger(bytes);
             Assert.Equal(bi, bi2);
         }
+
+        public static IEnumerable<object[]> FromIntTests_MemberData() =>
+            MatrixGenerator(FromIntTests_MemberDataSeed(), false);
+
+        [Theory]
+        [MemberData(nameof(FromIntTests_MemberData))]
+        public void ToByteArray_FromIntTests(int i, bool isUnsigned, bool isBigEndian, byte[] expectedBytes)
+        {
+            BigInteger bi = new BigInteger(i);
+
+            if (i < 0 && isUnsigned)
+            {
+                Assert.Throws<OverflowException>(() => bi.ToByteArray(isUnsigned, isBigEndian));
+                return;
+            }
+
+            byte[] bytes = bi.ToByteArray(isUnsigned, isBigEndian);
+            Assert.Equal(expectedBytes, bytes);
+            BigInteger bi2 = new BigInteger(bytes, isUnsigned, isBigEndian);
+            Assert.Equal(bi, bi2);
+        }
+
+        public static IEnumerable<object[]> FromLongTests_MemberData() =>
+            MatrixGenerator(FromLongTests_MemberDataSeed(), false);
+
+        [Theory]
+        [MemberData(nameof(FromLongTests_MemberData))]
+        public void ToByteArray_FromLongTests(long l, bool isUnsigned, bool isBigEndian, byte[] expectedBytes)
+        {
+            BigInteger bi = new BigInteger(l);
+
+            if (l < 0 && isUnsigned)
+            {
+                Assert.Throws<OverflowException>(() => bi.ToByteArray(isUnsigned, isBigEndian));
+                return;
+            }
+
+            byte[] bytes = bi.ToByteArray(isUnsigned, isBigEndian);
+            Assert.Equal(expectedBytes, bytes);
+            BigInteger bi2 = new BigInteger(bytes, isUnsigned, isBigEndian);
+            Assert.Equal(bi, bi2);
+        }
+
+        public static IEnumerable<object[]> FromStringTests_MemberData() =>
+            MatrixGenerator(FromStringTests_MemberDataSeed(), true);
+
+        [Theory]
+        [MemberData(nameof(FromStringTests_MemberData))]
+        public void ToByteArray_FromStringTests(string str, bool isUnsigned, bool isBigEndian, byte[] expectedBytes)
+        {
+            BigInteger bi = BigInteger.Parse(str);
+
+            if (str[0] == '-' && isUnsigned)
+            {
+                Assert.Throws<OverflowException>(() => bi.ToByteArray(isUnsigned, isBigEndian));
+                return;
+            }
+
+            byte[] bytes = bi.ToByteArray(isUnsigned, isBigEndian);
+            Assert.Equal(expectedBytes, bytes);
+            BigInteger bi2 = new BigInteger(bytes, isUnsigned, isBigEndian);
+            Assert.Equal(bi, bi2);
+        }
+
+        private static IEnumerable<object[]> MatrixGenerator(IEnumerable<object[]> seedData, bool dataIsBigEndian)
+        {
+            foreach (object[] seed in seedData)
+            {
+                object value = seed[0];
+                byte[] leSignedBytes = (byte[])seed[1];
+                byte[] beSignedBytes = (byte[])leSignedBytes.Clone();
+                Array.Reverse(beSignedBytes);
+
+                if (dataIsBigEndian)
+                {
+                    var tmp = leSignedBytes;
+                    leSignedBytes = beSignedBytes;
+                    beSignedBytes = tmp;
+                }
+
+                // Signed Little Endian
+                yield return new object[] { value, false, false, leSignedBytes };
+
+                // Signed Big Endian
+                yield return new object[] { value, false, true, beSignedBytes };
+
+                byte[] leUnsignedBytes;
+                byte[] beUnsignedBytes;
+
+                if (beSignedBytes.Length > 1 &&
+                    beSignedBytes[0] == 0)
+                {
+                    leUnsignedBytes = new Span<byte>(leSignedBytes, 0, leSignedBytes.Length - 1).ToArray();
+                    beUnsignedBytes = new Span<byte>(beSignedBytes, 1, beSignedBytes.Length - 1).ToArray();
+                }
+                else
+                {
+                    // No padding was required, the unsigned data is the same as the signed data.
+                    leUnsignedBytes = leSignedBytes;
+                    beUnsignedBytes = beSignedBytes;
+                }
+
+                // Unsigned Big Endian
+                yield return new object[] { value, true, true, beUnsignedBytes };
+
+                // Unsigned Little Endian
+                yield return new object[] { value, true, false, leUnsignedBytes };
+            }
+        }
     }
 }
diff --git a/src/libraries/System.Runtime.Numerics/tests/BigInteger/ToByteArray.netcoreapp.cs b/src/libraries/System.Runtime.Numerics/tests/BigInteger/ToByteArray.netcoreapp.cs
deleted file mode 100644 (file)
index 80a354c..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-// 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.Collections.Generic;
-using Xunit;
-
-namespace System.Numerics.Tests
-{
-    public partial class ExtractBytesMembersTests
-    {
-        public static IEnumerable<object[]> FromIntTests_MemberData() =>
-            MatrixGenerator(FromIntTests_MemberDataSeed(), false);
-
-        [Theory]
-        [MemberData(nameof(FromIntTests_MemberData))]
-        public void ToByteArray_FromIntTests(int i, bool isUnsigned, bool isBigEndian, byte[] expectedBytes)
-        {
-            BigInteger bi = new BigInteger(i);
-
-            if (i < 0 && isUnsigned)
-            {
-                Assert.Throws<OverflowException>(() => bi.ToByteArray(isUnsigned, isBigEndian));
-                return;
-            }
-
-            byte[] bytes = bi.ToByteArray(isUnsigned, isBigEndian);
-            Assert.Equal(expectedBytes, bytes);
-            BigInteger bi2 = new BigInteger(bytes, isUnsigned, isBigEndian);
-            Assert.Equal(bi, bi2);
-        }
-
-        public static IEnumerable<object[]> FromLongTests_MemberData() =>
-            MatrixGenerator(FromLongTests_MemberDataSeed(), false);
-
-        [Theory]
-        [MemberData(nameof(FromLongTests_MemberData))]
-        public void ToByteArray_FromLongTests(long l, bool isUnsigned, bool isBigEndian, byte[] expectedBytes)
-        {
-            BigInteger bi = new BigInteger(l);
-
-            if (l < 0 && isUnsigned)
-            {
-                Assert.Throws<OverflowException>(() => bi.ToByteArray(isUnsigned, isBigEndian));
-                return;
-            }
-
-            byte[] bytes = bi.ToByteArray(isUnsigned, isBigEndian);
-            Assert.Equal(expectedBytes, bytes);
-            BigInteger bi2 = new BigInteger(bytes, isUnsigned, isBigEndian);
-            Assert.Equal(bi, bi2);
-        }
-
-        public static IEnumerable<object[]> FromStringTests_MemberData() =>
-            MatrixGenerator(FromStringTests_MemberDataSeed(), true);
-
-        [Theory]
-        [MemberData(nameof(FromStringTests_MemberData))]
-        public void ToByteArray_FromStringTests(string str, bool isUnsigned, bool isBigEndian, byte[] expectedBytes)
-        {
-            BigInteger bi = BigInteger.Parse(str);
-
-            if (str[0] == '-' && isUnsigned)
-            {
-                Assert.Throws<OverflowException>(() => bi.ToByteArray(isUnsigned, isBigEndian));
-                return;
-            }
-
-            byte[] bytes = bi.ToByteArray(isUnsigned, isBigEndian);
-            Assert.Equal(expectedBytes, bytes);
-            BigInteger bi2 = new BigInteger(bytes, isUnsigned, isBigEndian);
-            Assert.Equal(bi, bi2);
-        }
-
-        private static IEnumerable<object[]> MatrixGenerator(IEnumerable<object[]> seedData, bool dataIsBigEndian)
-        {
-            foreach (object[] seed in seedData)
-            {
-                object value = seed[0];
-                byte[] leSignedBytes = (byte[])seed[1];
-                byte[] beSignedBytes = (byte[])leSignedBytes.Clone();
-                Array.Reverse(beSignedBytes);
-
-                if (dataIsBigEndian)
-                {
-                    var tmp = leSignedBytes;
-                    leSignedBytes = beSignedBytes;
-                    beSignedBytes = tmp;
-                }
-
-                // Signed Little Endian
-                yield return new object[] { value, false, false, leSignedBytes };
-
-                // Signed Big Endian
-                yield return new object[] { value, false, true, beSignedBytes };
-
-                byte[] leUnsignedBytes;
-                byte[] beUnsignedBytes;
-
-                if (beSignedBytes.Length > 1 &&
-                    beSignedBytes[0] == 0)
-                {
-                    leUnsignedBytes = new Span<byte>(leSignedBytes, 0, leSignedBytes.Length - 1).ToArray();
-                    beUnsignedBytes = new Span<byte>(beSignedBytes, 1, beSignedBytes.Length - 1).ToArray();
-                }
-                else
-                {
-                    // No padding was required, the unsigned data is the same as the signed data.
-                    leUnsignedBytes = leSignedBytes;
-                    beUnsignedBytes = beSignedBytes;
-                }
-
-                // Unsigned Big Endian
-                yield return new object[] { value, true, true, beUnsignedBytes };
-
-                // Unsigned Little Endian
-                yield return new object[] { value, true, false, leUnsignedBytes };
-            }
-        }
-    }
-}
index f9b5512..b28fcfd 100644 (file)
@@ -6,7 +6,7 @@ using Xunit;
 
 namespace System.Numerics.Tests
 {
-    public partial class BigIntegerConstructorTest
+    public class BigIntegerConstructorTest
     {
         private static int s_samples = 10;
         private static Random s_random = new Random(100);
@@ -957,7 +957,9 @@ namespace System.Numerics.Tests
 
             VerifyCtorByteArray(value);
         }
-        static partial void VerifyCtorByteSpan(byte[] value);
+
+        static void VerifyCtorByteSpan(byte[] value) =>
+            Assert.Equal(new BigInteger(value), new BigInteger(new ReadOnlySpan<byte>(value)));
 
         private static void VerifyCtorByteArray(byte[] value)
         {
diff --git a/src/libraries/System.Runtime.Numerics/tests/BigInteger/ctor.netcoreapp.cs b/src/libraries/System.Runtime.Numerics/tests/BigInteger/ctor.netcoreapp.cs
deleted file mode 100644 (file)
index d11723b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// 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 Xunit;
-
-namespace System.Numerics.Tests
-{
-    public partial class BigIntegerConstructorTest
-    {
-        static partial void VerifyCtorByteSpan(byte[] value) =>
-            Assert.Equal(new BigInteger(value), new BigInteger(new ReadOnlySpan<byte>(value)));
-    }
-}
index 8b184c2..dfdec5c 100644 (file)
@@ -12,7 +12,7 @@ using Xunit;
 
 namespace System.Numerics.Tests
 {
-    public partial class parseTest
+    public class parseTest
     {
         private static readonly int s_samples = 10;
         private static readonly Random s_random = new Random(100);
@@ -83,6 +83,29 @@ namespace System.Numerics.Tests
             }
         }
 
+        [Theory]
+        [InlineData("123456789", 0, 9, "123456789")]
+        [InlineData("123456789", 0, 1, "1")]
+        [InlineData("123456789", 1, 3, "234")]
+        [InlineData("123456789", 8, 1, "9")]
+        [InlineData("123456789abc", 8, 1, "9")]
+        [InlineData("1\03456789", 0, 1, "1")]
+        [InlineData("1\03456789", 0, 2, "1")]
+        [InlineData("123456789\0", 0, 10, "123456789")]
+        public void Parse_Subspan_Success(string input, int offset, int length, string expected)
+        {
+            Eval(BigInteger.Parse(input.AsSpan(offset, length)), expected);
+            Assert.True(BigInteger.TryParse(input.AsSpan(offset, length), out BigInteger test));
+            Eval(test, expected);
+        }
+
+        [Fact]
+        public void Parse_EmptySubspan_Fails()
+        {
+            Assert.False(BigInteger.TryParse("12345".AsSpan(0, 0), out BigInteger result));
+            Assert.Equal(0, result);
+        }
+
         private static void RunFormatProviderParseStrings()
         {
             NumberFormatInfo nfi = new NumberFormatInfo();
@@ -397,7 +420,33 @@ namespace System.Numerics.Tests
             VerifyParseToString(num1, ns, failureNotExpected, Fix(num1.Trim(), ((ns & NumberStyles.AllowHexSpecifier) != 0), failureNotExpected));
         }
 
-        static partial void VerifyParseSpanToString(string num1, NumberStyles ns, bool failureNotExpected, string expected);
+        static void VerifyParseSpanToString(string num1, NumberStyles ns, bool failureNotExpected, string expected)
+        {
+            if (failureNotExpected)
+            {
+                Eval(BigInteger.Parse(num1.AsSpan(), ns), expected);
+
+                Assert.True(BigInteger.TryParse(num1.AsSpan(), ns, provider: null, out BigInteger test));
+                Eval(test, expected);
+
+                if (ns == NumberStyles.Integer)
+                {
+                    Assert.True(BigInteger.TryParse(num1.AsSpan(), out test));
+                    Eval(test, expected);
+                }
+            }
+            else
+            {
+                Assert.Throws<FormatException>(() => { BigInteger.Parse(num1.AsSpan(), ns); });
+
+                Assert.False(BigInteger.TryParse(num1.AsSpan(), ns, provider: null, out BigInteger test));
+
+                if (ns == NumberStyles.Integer)
+                {
+                    Assert.False(BigInteger.TryParse(num1.AsSpan(), out test));
+                }
+            }
+        }
 
         private static void VerifyParseToString(string num1, NumberStyles ns, bool failureNotExpected, string expected)
         {
@@ -428,7 +477,20 @@ namespace System.Numerics.Tests
             }
         }
 
-        static partial void VerifySimpleFormatParseSpan(string num1, NumberFormatInfo nfi, BigInteger expected, bool failureExpected);
+        static void VerifySimpleFormatParseSpan(string num1, NumberFormatInfo nfi, BigInteger expected, bool failureExpected)
+        {
+            if (!failureExpected)
+            {
+                Assert.Equal(expected, BigInteger.Parse(num1.AsSpan(), provider: nfi));
+                Assert.True(BigInteger.TryParse(num1.AsSpan(), NumberStyles.Any, nfi, out BigInteger test));
+                Assert.Equal(expected, test);
+            }
+            else
+            {
+                Assert.Throws<FormatException>(() => { BigInteger.Parse(num1.AsSpan(), provider: nfi); });
+                Assert.False(BigInteger.TryParse(num1.AsSpan(), NumberStyles.Any, nfi, out BigInteger test), string.Format("Expected TryParse to fail on {0}", num1));
+            }
+        }
 
         private static void VerifySimpleFormatParse(string num1, NumberFormatInfo nfi, BigInteger expected, bool failureExpected = false)
         {
@@ -452,7 +514,20 @@ namespace System.Numerics.Tests
             }
         }
 
-        static partial void VerifyFormatParseSpan(string s, NumberStyles ns, NumberFormatInfo nfi, BigInteger expected, bool failureExpected);
+        static void VerifyFormatParseSpan(string num1, NumberStyles ns, NumberFormatInfo nfi, BigInteger expected, bool failureExpected)
+        {
+            if (!failureExpected)
+            {
+                Assert.Equal(expected, BigInteger.Parse(num1.AsSpan(), ns, nfi));
+                Assert.True(BigInteger.TryParse(num1.AsSpan(), NumberStyles.Any, nfi, out BigInteger test));
+                Assert.Equal(expected, test);
+            }
+            else
+            {
+                Assert.Throws<FormatException>(() => { BigInteger.Parse(num1.AsSpan(), ns, nfi); });
+                Assert.False(BigInteger.TryParse(num1.AsSpan(), ns, nfi, out BigInteger test), string.Format("Expected TryParse to fail on {0}", num1));
+            }
+        }
 
         private static void VerifyFormatParse(string num1, NumberStyles ns, NumberFormatInfo nfi, BigInteger expected, bool failureExpected = false)
         {
diff --git a/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.netcoreapp.cs b/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.netcoreapp.cs
deleted file mode 100644 (file)
index 1231cd9..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-// 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.Globalization;
-using Xunit;
-
-namespace System.Numerics.Tests
-{
-    public partial class parseTest
-    {
-        [Theory]
-        [InlineData("123456789", 0, 9, "123456789")]
-        [InlineData("123456789", 0, 1, "1")]
-        [InlineData("123456789", 1, 3, "234")]
-        [InlineData("123456789", 8, 1, "9")]
-        [InlineData("123456789abc", 8, 1, "9")]
-        [InlineData("1\03456789", 0, 1, "1")]
-        [InlineData("1\03456789", 0, 2, "1")]
-        [InlineData("123456789\0", 0, 10, "123456789")]
-        public void Parse_Subspan_Success(string input, int offset, int length, string expected)
-        {
-            Eval(BigInteger.Parse(input.AsSpan(offset, length)), expected);
-            Assert.True(BigInteger.TryParse(input.AsSpan(offset, length), out BigInteger test));
-            Eval(test, expected);
-        }
-
-        [Fact]
-        public void Parse_EmptySubspan_Fails()
-        {
-            Assert.False(BigInteger.TryParse("12345".AsSpan(0, 0), out BigInteger result));
-            Assert.Equal(0, result);
-        }
-
-        static partial void VerifyParseSpanToString(string num1, NumberStyles ns, bool failureNotExpected, string expected)
-        {
-            if (failureNotExpected)
-            {
-                Eval(BigInteger.Parse(num1.AsSpan(), ns), expected);
-
-                Assert.True(BigInteger.TryParse(num1.AsSpan(), ns, provider: null, out BigInteger test));
-                Eval(test, expected);
-
-                if (ns == NumberStyles.Integer)
-                {
-                    Assert.True(BigInteger.TryParse(num1.AsSpan(), out test));
-                    Eval(test, expected);
-                }
-            }
-            else
-            {
-                Assert.Throws<FormatException>(() => { BigInteger.Parse(num1.AsSpan(), ns); });
-
-                Assert.False(BigInteger.TryParse(num1.AsSpan(), ns, provider: null, out BigInteger test));
-
-                if (ns == NumberStyles.Integer)
-                {
-                    Assert.False(BigInteger.TryParse(num1.AsSpan(), out test));
-                }
-            }
-        }
-
-        static partial void VerifySimpleFormatParseSpan(string num1, NumberFormatInfo nfi, BigInteger expected, bool failureExpected)
-        {
-            if (!failureExpected)
-            {
-                Assert.Equal(expected, BigInteger.Parse(num1.AsSpan(), provider: nfi));
-                Assert.True(BigInteger.TryParse(num1.AsSpan(), NumberStyles.Any, nfi, out BigInteger test));
-                Assert.Equal(expected, test);
-            }
-            else
-            {
-                Assert.Throws<FormatException>(() => { BigInteger.Parse(num1.AsSpan(), provider: nfi); });
-                Assert.False(BigInteger.TryParse(num1.AsSpan(), NumberStyles.Any, nfi, out BigInteger test), string.Format("Expected TryParse to fail on {0}", num1));
-            }
-        }
-
-        static partial void VerifyFormatParseSpan(string num1, NumberStyles ns, NumberFormatInfo nfi, BigInteger expected, bool failureExpected)
-        {
-            if (!failureExpected)
-            {
-                Assert.Equal(expected, BigInteger.Parse(num1.AsSpan(), ns, nfi));
-                Assert.True(BigInteger.TryParse(num1.AsSpan(), NumberStyles.Any, nfi, out BigInteger test));
-                Assert.Equal(expected, test);
-            }
-            else
-            {
-                Assert.Throws<FormatException>(() => { BigInteger.Parse(num1.AsSpan(), ns, nfi); });
-                Assert.False(BigInteger.TryParse(num1.AsSpan(), ns, nfi, out BigInteger test), string.Format("Expected TryParse to fail on {0}", num1));
-            }
-        }
-    }
-}
index 2903b37..0cfd48f 100644 (file)
@@ -10,7 +10,7 @@ using Xunit;
 
 namespace System.Numerics.Tests
 {
-    public partial class ComplexTests
+    public class ComplexTests
     {
         private static Random s_random = new Random(-55);
         private static bool Is64Bit => IntPtr.Size == 8;
@@ -1909,6 +1909,61 @@ namespace System.Numerics.Tests
             VerifyRealImaginaryProperties(complex, (double)value, 0);
         }
 
+        [Fact]
+        public static void NaN()
+        {
+            Assert.True(Complex.IsNaN(new Complex(double.NaN, double.NaN)));
+            Assert.True(Complex.IsNaN(new Complex(1, double.NaN)));
+            Assert.True(Complex.IsNaN(new Complex(double.NaN, 1)));
+            Assert.True(Complex.IsNaN(Complex.NaN));
+
+            Assert.False(Complex.IsNaN(new Complex(double.PositiveInfinity, double.NaN)));
+            Assert.False(Complex.IsNaN(new Complex(double.NaN, double.PositiveInfinity)));
+            Assert.False(Complex.IsNaN(Complex.Infinity));
+
+            VerifyRealImaginaryProperties(Complex.NaN, double.NaN, double.NaN);
+            VerifyMagnitudePhaseProperties(Complex.NaN, double.NaN, double.NaN);
+        }
+
+        [Fact]
+        public static void Infinity()
+        {
+            Assert.True(Complex.IsInfinity(new Complex(double.PositiveInfinity, double.PositiveInfinity)));
+            Assert.True(Complex.IsInfinity(new Complex(1, double.PositiveInfinity)));
+            Assert.True(Complex.IsInfinity(new Complex(double.PositiveInfinity, 1)));
+
+            Assert.True(Complex.IsInfinity(new Complex(double.NegativeInfinity, double.NegativeInfinity)));
+            Assert.True(Complex.IsInfinity(new Complex(1, double.NegativeInfinity)));
+            Assert.True(Complex.IsInfinity(new Complex(double.NegativeInfinity, 1)));
+
+            Assert.True(Complex.IsInfinity(Complex.Infinity));
+            Assert.False(Complex.IsInfinity(Complex.NaN));
+
+
+            VerifyRealImaginaryProperties(Complex.Infinity, double.PositiveInfinity, double.PositiveInfinity);
+            VerifyMagnitudePhaseProperties(Complex.Infinity, double.PositiveInfinity, Math.PI / 4);
+        }
+
+        [Fact]
+        public static void Finite()
+        {
+            Assert.False(Complex.IsFinite(new Complex(double.NaN, double.NaN)));
+            Assert.False(Complex.IsFinite(new Complex(1, double.NaN)));
+            Assert.False(Complex.IsFinite(new Complex(double.NaN, 1)));
+
+            Assert.False(Complex.IsFinite(new Complex(double.PositiveInfinity, double.PositiveInfinity)));
+            Assert.False(Complex.IsFinite(new Complex(1, double.PositiveInfinity)));
+            Assert.False(Complex.IsFinite(new Complex(double.PositiveInfinity, 1)));
+
+            Assert.False(Complex.IsFinite(new Complex(double.NegativeInfinity, double.NegativeInfinity)));
+            Assert.False(Complex.IsFinite(new Complex(1, double.NegativeInfinity)));
+            Assert.False(Complex.IsFinite(new Complex(double.NegativeInfinity, 1)));
+
+            Assert.False(Complex.IsFinite(Complex.Infinity));
+            Assert.False(Complex.IsFinite(Complex.NaN));
+            Assert.True(Complex.IsFinite(Complex.ImaginaryOne));
+        }
+
         private static double SmallRandomPositiveDouble()
         {
             return RandomPositiveValue(1);
diff --git a/src/libraries/System.Runtime.Numerics/tests/ComplexTests.netcoreapp.cs b/src/libraries/System.Runtime.Numerics/tests/ComplexTests.netcoreapp.cs
deleted file mode 100644 (file)
index 75068c8..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// 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.Collections.Generic;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-using Xunit;
-
-namespace System.Numerics.Tests
-{
-    public partial class ComplexTests
-    {
-        [Fact]
-        public static void NaN()
-        {
-            Assert.True(Complex.IsNaN(new Complex(double.NaN, double.NaN)));
-            Assert.True(Complex.IsNaN(new Complex(1, double.NaN)));
-            Assert.True(Complex.IsNaN(new Complex(double.NaN, 1)));
-            Assert.True(Complex.IsNaN(Complex.NaN));
-
-            Assert.False(Complex.IsNaN(new Complex(double.PositiveInfinity, double.NaN)));
-            Assert.False(Complex.IsNaN(new Complex(double.NaN, double.PositiveInfinity)));
-            Assert.False(Complex.IsNaN(Complex.Infinity));
-
-            VerifyRealImaginaryProperties(Complex.NaN, double.NaN, double.NaN);
-            VerifyMagnitudePhaseProperties(Complex.NaN, double.NaN, double.NaN);
-        }
-
-        [Fact]
-        public static void Infinity()
-        {
-            Assert.True(Complex.IsInfinity(new Complex(double.PositiveInfinity, double.PositiveInfinity)));
-            Assert.True(Complex.IsInfinity(new Complex(1, double.PositiveInfinity)));
-            Assert.True(Complex.IsInfinity(new Complex(double.PositiveInfinity, 1)));
-
-            Assert.True(Complex.IsInfinity(new Complex(double.NegativeInfinity, double.NegativeInfinity)));
-            Assert.True(Complex.IsInfinity(new Complex(1, double.NegativeInfinity)));
-            Assert.True(Complex.IsInfinity(new Complex(double.NegativeInfinity, 1)));
-
-            Assert.True(Complex.IsInfinity(Complex.Infinity));
-            Assert.False(Complex.IsInfinity(Complex.NaN));
-
-
-            VerifyRealImaginaryProperties(Complex.Infinity, double.PositiveInfinity, double.PositiveInfinity);
-            VerifyMagnitudePhaseProperties(Complex.Infinity, double.PositiveInfinity, Math.PI / 4);
-        }
-
-        [Fact]
-        public static void Finite()
-        {
-            Assert.False(Complex.IsFinite(new Complex(double.NaN, double.NaN)));
-            Assert.False(Complex.IsFinite(new Complex(1, double.NaN)));
-            Assert.False(Complex.IsFinite(new Complex(double.NaN, 1)));
-
-            Assert.False(Complex.IsFinite(new Complex(double.PositiveInfinity, double.PositiveInfinity)));
-            Assert.False(Complex.IsFinite(new Complex(1, double.PositiveInfinity)));
-            Assert.False(Complex.IsFinite(new Complex(double.PositiveInfinity, 1)));
-
-            Assert.False(Complex.IsFinite(new Complex(double.NegativeInfinity, double.NegativeInfinity)));
-            Assert.False(Complex.IsFinite(new Complex(1, double.NegativeInfinity)));
-            Assert.False(Complex.IsFinite(new Complex(double.NegativeInfinity, 1)));
-
-            Assert.False(Complex.IsFinite(Complex.Infinity));
-            Assert.False(Complex.IsFinite(Complex.NaN));
-            Assert.True(Complex.IsFinite(Complex.ImaginaryOne));
-        }
-    }
-}
index bdc7136..6db2419 100644 (file)
@@ -6,7 +6,6 @@
   <ItemGroup>
     <Compile Include="BigInteger\absolutevalue.cs" />
     <Compile Include="BigInteger\BigIntegerToStringTests.cs" />
-    <Compile Include="BigInteger\BigIntegerToStringTests.netcoreapp.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
     <Compile Include="BigInteger\BigInteger.AddTests.cs" />
     <Compile Include="BigInteger\BigInteger.SubtractTests.cs" />
     <Compile Include="BigInteger\BigIntTools.cs" />
@@ -14,7 +13,6 @@
     <Compile Include="BigInteger\cast_to.cs" />
     <Compile Include="BigInteger\Comparison.cs" />
     <Compile Include="BigInteger\ctor.cs" />
-    <Compile Include="BigInteger\ctor.netcoreapp.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
     <Compile Include="BigInteger\divide.cs" />
     <Compile Include="BigInteger\divrem.cs" />
     <Compile Include="BigInteger\Driver.cs" />
     <Compile Include="BigInteger\op_rightshift.cs" />
     <Compile Include="BigInteger\op_xor.cs" />
     <Compile Include="BigInteger\parse.cs" />
-    <Compile Include="BigInteger\parse.netcoreapp.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
     <Compile Include="BigInteger\pow.cs" />
     <Compile Include="BigInteger\properties.cs" />
     <Compile Include="BigInteger\remainder.cs" />
     <Compile Include="BigInteger\sign.cs" />
     <Compile Include="BigInteger\stackcalculator.cs" />
     <Compile Include="BigInteger\ToByteArray.cs" />
-    <Compile Include="BigInteger\ToByteArray.netcoreapp.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
-    <Compile Include="BigInteger\TryWriteBytes.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
+    <Compile Include="BigInteger\TryWriteBytes.cs" />
     <Compile Include="ComplexTests.cs" />
-    <Compile Include="ComplexTests.netcoreapp.cs" Condition="'$(TargetsNetCoreApp)' == 'true'" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index 0996f12..a31bad6 100644 (file)
     <Compile Include="$(CommonPath)..\tests\System\RealFormatterTestsBase.netcoreapp.cs" Link="System\RealFormatterTestsBase.netcoreapp.cs" />
     <Compile Include="System\RealFormatterTests.cs" />
     <Compile Include="$(CommonPath)..\tests\System\RealParserTestsBase.netcoreapp.cs" Link="System\RealParserTestsBase.netcoreapp.cs" />
-    <Compile Include="System\RealParserTests.netcoreapp.cs" />
+    <Compile Include="System\RealParserTests.cs" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsNetCoreApp)' != 'true'">
     <Compile Include="System\StringSplitExtensions.cs" />