Skip to content

Commit 70281f8

Browse files
IntegrationTestBase: Pass TextSpan to SourceText.ToString(...)
1 parent 6fc5f2e commit 70281f8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,7 @@ protected void AssertSourceMappingsMatchBaseline(RazorCodeDocument codeDocument,
494494
{
495495
if (mapping.OriginalSpan == sourceSpan)
496496
{
497-
var actualSpan = csharpDocument.Text.ToString().Substring(
498-
mapping.GeneratedSpan.AbsoluteIndex,
499-
mapping.GeneratedSpan.Length);
497+
var actualSpan = csharpDocument.Text.ToString(mapping.GeneratedSpan.AsTextSpan());
500498

501499
if (!string.Equals(expectedSpan, actualSpan, StringComparison.Ordinal))
502500
{

0 commit comments

Comments
 (0)