Skip to content

Commit a0b00a6

Browse files
committed
Enable debug asserts in on type formatting tests
1 parent e3ddd05 commit a0b00a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private protected async Task RunOnTypeFormattingTestAsync(
166166
filePathService, new TestDocumentContextFactory(), LoggerFactory);
167167
var languageKind = codeDocument.GetLanguageKind(positionAfterTrigger, rightAssociative: false);
168168

169-
var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, TestOutputHelper, codeDocument, razorLSPOptions, languageServerFeatureOptions);
169+
var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, TestOutputHelper, codeDocument, razorLSPOptions, languageServerFeatureOptions, debugAssertsEnabled: true);
170170
var options = new FormattingOptions()
171171
{
172172
TabSize = tabSize,

src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/Formatting/FormattingTestBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ private protected async Task RunOnTypeFormattingTestAsync(
123123
var position = inputText.GetPosition(input.Position);
124124

125125
var formattingService = (RazorFormattingService)OOPExportProvider.GetExportedValue<IRazorFormattingService>();
126-
formattingService.GetTestAccessor().SetFormattingLoggerFactory(new TestFormattingLoggerFactory(TestOutputHelper));
126+
var accessor = formattingService.GetTestAccessor();
127+
accessor.SetDebugAssertsEnabled(debugAssertsEnabled: true);
128+
accessor.SetFormattingLoggerFactory(new TestFormattingLoggerFactory(TestOutputHelper));
127129

128130
var generatedHtml = await RemoteServiceInvoker.TryInvokeAsync<IRemoteHtmlDocumentService, string?>(document.Project.Solution,
129131
(service, solutionInfo, ct) => service.GetHtmlDocumentTextAsync(solutionInfo, document.Id, ct),

0 commit comments

Comments
 (0)