Make Debug.Print(string) behavior consistent with .NET Framework (#25036)
authorMaryam Ariyan <maryam.ariyan@microsoft.com>
Mon, 10 Jun 2019 21:09:07 +0000 (14:09 -0700)
committerGitHub <noreply@github.com>
Mon, 10 Jun 2019 21:09:07 +0000 (14:09 -0700)
*     Debug.Print should call Debug.WriteLine
    - to behave similar to .NET Framework

* temporarily disable tests
- Waiting for coreclr/fx changes to propagate

src/System.Private.CoreLib/shared/System/Diagnostics/Debug.cs
tests/CoreFX/CoreFX.issues.rsp

index 251ac22..8e98288 100644 (file)
@@ -77,13 +77,13 @@ namespace System.Diagnostics
         [System.Diagnostics.Conditional("DEBUG")]
         public static void Print(string? message)
         {
-            Write(message);
+            WriteLine(message);
         }
 
         [System.Diagnostics.Conditional("DEBUG")]
         public static void Print(string format, params object?[] args)
         {
-            Write(string.Format(null, format, args));
+            WriteLine(string.Format(null, format, args));
         }
 
         [System.Diagnostics.Conditional("DEBUG")]
index 517d918..743f0d5 100644 (file)
@@ -51,6 +51,8 @@
 -nomethod System.Tests.AppDomainTests.MonitoringTotalAllocatedMemorySize
 -nomethod System.Tests.AppDomainTests.MonitoringTotalProcessorTime
 -nomethod System.Text.Tests.StringBuilderTests.AppendFormat
+-nomethod System.Diagnostics.Tests.DebugTestsNoListeners.Print
+-nomethod System.Diagnostics.Tests.DebugTestsUsingListeners.Print
 
 # requires corefx test updates
 -nomethod System.Tests.EnvironmentTests.FailFast_ExceptionStackTrace_StackOverflowException
@@ -68,4 +70,4 @@
 -nomethod System.Tests.StringTests.CasingNegativeTest
 -nomethod System.Tests.StringTests.CompareNegativeTest
 -nomethod System.Tests.StringTests.ToLowerNullCulture
--nomethod System.Tests.StringTests.ToUpperNullCulture
+-nomethod System.Tests.StringTests.ToUpperNullCulture
\ No newline at end of file