提交 ff3c18bb 编写于 作者: V Vladimir Reshetnikov

Use proper C# decimal separator '.' in TestIncrementCompilationAndOutput

上级 44ffa0ab
// 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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册