/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/CSharpTest/Formatting/FormattingTests_FunctionPointers.cs
99 строк
3 KB
Cyrus Najmabadi
Use raw strings in tests
09 июл 2025, 08:52
09 июл 2025, 08:52
f265dce
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System.Threading.Tasks; using Microsoft.CodeAnalysis.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Formatting; [Trait(Traits.Feature, Traits.Features.Formatting)] public sealed class FormattingTests_FunctionPointers : CSharpFormattingTestBase { [Fact] public Task FormatFunctionPointer() => AssertFormatAsync(""" unsafe class C { delegate*<int, int> functionPointer; } """, """ unsafe class C { delegate * < int , int > functionPointer; } """); [Fact] public Task FormatFunctionPointerWithManagedCallingConvention() => AssertFormatAsync(""" unsafe class C { delegate* managed<int, int> functionPointer; } """, """ unsafe class C { delegate *managed < int , int > functionPointer; } """); [Fact] public Task FormatFunctionPointerWithUnmanagedCallingConvention() => AssertFormatAsync(""" unsafe class C { delegate* unmanaged<int, int> functionPointer; } """, """ unsafe class C { delegate *unmanaged < int , int > functionPointer; } """); [Fact] public Task FormatFunctionPointerWithUnmanagedCallingConventionAndSpecifiers() => AssertFormatAsync(""" unsafe class C { delegate* unmanaged[Cdecl, Thiscall]<int, int> functionPointer; } """, """ unsafe class C { delegate *unmanaged [ Cdecl , Thiscall ] < int , int > functionPointer; } """); [Fact] public Task FormatFunctionPointerWithUnrecognizedCallingConvention() => AssertFormatAsync(""" unsafe class C { delegate*invalid <int, int> functionPointer; } """, """ unsafe class C { delegate *invalid < int , int > functionPointer; } """); [Fact] public Task FormatFunctionPointerWithInvalidCallingConventionAndSpecifiers() => AssertFormatAsync(""" unsafe class C { delegate*invalid [Cdecl, Thiscall]<int, int> functionPointer; } """, """ unsafe class C { delegate *invalid [ Cdecl , Thiscall ] < int , int > functionPointer; } """); }