/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/VisualBasicTest/VisualBasicExtensionsTests.vb
37 строк
1 KB
Cyrus Najmabadi
Organize VB imports
27 июн 2025, 21:53
27 июн 2025, 21:53
e9c47fd
Код
Авторство
О чём код?
' 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. Imports System.Text Imports System.Threading Imports Microsoft.CodeAnalysis.VisualBasic.Extensions.SyntaxTreeExtensions Imports Roslyn.Test.Utilities Imports Xunit Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class VisualBasicExtensionsTests <Fact, WorkItem("https://github.com/dotnet/roslyn/issues/6536")> Public Sub TestFindTrivia_NoStackOverflowOnLargeExpression() Dim code As New StringBuilder() code.Append(<![CDATA[ Module Module1 Sub Test() Dim c = ]]>.Value) For i = 0 To 3000 code.Append("""asdf"" + ") Next code.AppendLine(<![CDATA["last" End Sub End Module]]>.Value) Dim tree = VisualBasicSyntaxTree.ParseText(code.ToString()) Dim trivia = tree.FindTriviaToLeft(4000, CancellationToken.None) ' no stack overflow End Sub End Class End Namespace