diff --git a/src/Compilers/Test/Core/Diagnostics/DiagnosticDescription.cs b/src/Compilers/Test/Core/Diagnostics/DiagnosticDescription.cs index 01817d73a198a..89d683b133610 100644 --- a/src/Compilers/Test/Core/Diagnostics/DiagnosticDescription.cs +++ b/src/Compilers/Test/Core/Diagnostics/DiagnosticDescription.cs @@ -6,17 +6,18 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; +using System.Globalization; using System.Linq; using System.Text; using System.Text.RegularExpressions; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Text; +using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; -using Roslyn.Test.Utilities; -using Microsoft.CodeAnalysis.PooledObjects; -using Microsoft.CodeAnalysis.CSharp; -using System.Collections.Immutable; namespace Microsoft.CodeAnalysis.Test.Utilities { @@ -518,7 +519,7 @@ public static string GetAssertText(DiagnosticDescription[] expected, IEnumerable for (i = 0; e.MoveNext(); i++) { Diagnostic d = e.Current; - string message = d.ToString(); + string message = d.ToString(CultureInfo.InvariantCulture); if (Regex.Match(message, @"{\d+}").Success) { Assert.True(false, "Diagnostic messages should never contain unsubstituted placeholders.\n " + message); @@ -533,7 +534,7 @@ public static string GetAssertText(DiagnosticDescription[] expected, IEnumerable { Indent(assertText, indentDepth); assertText.Append("// "); - assertText.AppendLine(d.ToString()); + assertText.AppendLine(message); var l = d.Location; if (l.IsInSource) {