Removing double/float from the FormatterTests.Negative.cs tests.
authorTanner Gooding <tagoo@outlook.com>
Sun, 10 Feb 2019 03:40:27 +0000 (19:40 -0800)
committerStephen Toub <stoub@microsoft.com>
Mon, 11 Feb 2019 16:24:25 +0000 (11:24 -0500)
Commit migrated from https://github.com/dotnet/corefx/commit/f0b95b35c9a4f6af8733fdab2c1de193515438b6

src/libraries/System.Memory/tests/ParsersAndFormatters/Formatter/FormatterTests.Negative.cs

index 3f3eb9a..89c2b18 100644 (file)
@@ -12,6 +12,12 @@ namespace System.Buffers.Text.Tests
         [MemberData(nameof(TestData.TypesThatCanBeFormatted), MemberType = typeof(TestData))]
         public static void TestBadFormat(Type integerType)
         {
+            if ((integerType == typeof(double)) || (integerType == typeof(float)))
+            {
+                // double and float support all the same formats as the UTF16 formatter
+                return;
+            }
+
             object value = Activator.CreateInstance(integerType);
             Assert.Throws<FormatException>(() => TryFormatUtf8(value, Array.Empty<byte>(), out int bytesWritten, new StandardFormat('$', 1)));
         }
@@ -19,8 +25,6 @@ namespace System.Buffers.Text.Tests
         [Theory]
         [MemberData(nameof(TestData.IntegerTypesTheoryData), MemberType = typeof(TestData))]
         [InlineData(typeof(decimal))]
-        [InlineData(typeof(double))]
-        [InlineData(typeof(float))]
         public static void TestGFormatWithPrecisionNotSupported(Type type)
         {
             object value = Activator.CreateInstance(type);