diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIncrementTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIncrementTests.cs index 77172af808393840b52f503571b41b5136a33768..11922d4ca265db52fd1c8b48597c206f1081db54 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIncrementTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIncrementTests.cs @@ -1,11 +1,8 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.CodeAnalysis.CSharp.Symbols; -using Microsoft.CodeAnalysis.CSharp.Syntax; +using System.Globalization; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; -using Microsoft.CodeAnalysis.CSharp.UnitTests.Emit; -using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; using Xunit; @@ -1001,8 +998,9 @@ static int[] Array() Type type = typeof(T); Assert.True(type.IsPrimitive || type == typeof(decimal), string.Format("Type {0} is neither primitive nor decimal", type)); - string source = string.Format(NUMERIC_INCREMENT_TEMPLATE, type.FullName, value, valuePlusOne); - string expectedOutput = string.Format(NUMERIC_OUTPUT_TEMPLATE, value, valuePlusOne); + // Explicitly provide InvariantCulture to use the proper C# decimal separator '.' in the source regardless of the current culture + string source = string.Format(CultureInfo.InvariantCulture, NUMERIC_INCREMENT_TEMPLATE, type.FullName, value, valuePlusOne); + string expectedOutput = string.Format(CultureInfo.InvariantCulture, NUMERIC_OUTPUT_TEMPLATE, value, valuePlusOne); CompileAndVerify(source, expectedOutput: expectedOutput); }