Skip to content

Exception stack trace has first line incorrectly offset #5152

@nohwnd

Description

@nohwnd

Describe the bug

Steps To Reproduce

<!-- file mstest222.csproj -->
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <LangVersion>latest</LangVersion>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <EnableMSTestRunner>true</EnableMSTestRunner>
    <OutputType>Exe</OutputType>
    <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
    <!--
      Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
      For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
      -->
    <TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
    <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
    <PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.6.2" />
    <PackageReference Include="MSTest" Version="3.8.2" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
  </ItemGroup>

</Project>
// file MSTestSettings.cs
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
// file Test1.cs
namespace mstest222;

[TestClass]
public sealed class Test1
{
    [TestMethod]
    public void TestMethod1()
    {new A().B();
    }
}

public class A { 
    public void B() {
        throw new Exception("eeeee");
    }
}

Expected behavior

Actual behavior

Image

The first At is shifted too much to the right.

Metadata

Metadata

Assignees

Labels

Area: MTPBelongs to the Microsoft.Testing.Platform core libraryIn-PR

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions