From f9c971097b9bea6206cc328188ee1fc3bc984fd1 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Tue, 9 Apr 2019 09:28:47 -0700 Subject: [PATCH] Add test for string.Concat(object) that ToString returns null (#36436) --- src/Common/tests/Tests/System/StringTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Common/tests/Tests/System/StringTests.cs b/src/Common/tests/Tests/System/StringTests.cs index 2e23f798a5d6..4190825940fe 100644 --- a/src/Common/tests/Tests/System/StringTests.cs +++ b/src/Common/tests/Tests/System/StringTests.cs @@ -372,8 +372,6 @@ public static IEnumerable Concat_Objects_TestData() yield return new object[] { new object[] { 1 }, "1" }; yield return new object[] { new object[] { null }, "" }; - // dotnet/coreclr#6785, this will be null for the Concat(object) overload but "" for the object[]/IEnumerable overload - // yield return new object[] { new object[] { new ObjectWithNullToString() }, "" }; yield return new object[] { new object[] { 1, 2 }, "12" }; yield return new object[] { new object[] { null, 1 }, "1" }; @@ -400,6 +398,11 @@ public static IEnumerable Concat_Objects_TestData() // Concat should ignore objects that have a null ToString() value yield return new object[] { new object[] { new ObjectWithNullToString(), "Foo", new ObjectWithNullToString(), "Bar", new ObjectWithNullToString() }, "FooBar" }; + + if (!PlatformDetection.IsFullFramework) + { + yield return new object[] { new object[] { new ObjectWithNullToString() }, "" }; + } } [Theory]