Skip to content

Answer file parsing interprets \" as end of quoted string #15304

@nohwnd

Description

@nohwnd
    [TestMethod]
    public void TestCommandLineSplitter()
    {

        VerifyCommandLineSplitter("", []);
        VerifyCommandLineSplitter("/testadapterpath:\"c:\\Path\"", [@"/testadapterpath:c:\Path"]);
        VerifyCommandLineSplitter("/testadapterpath:\"c:\\Path\" /logger:\"trx\"", [@"/testadapterpath:c:\Path", "/logger:trx"]);
        VerifyCommandLineSplitter("/testadapterpath:\"c:\\Path\" /logger:\"trx\" /diag:\"log.txt\"", [@"/testadapterpath:c:\Path", "/logger:trx", "/diag:log.txt"]);

// New test case that fails!
        VerifyCommandLineSplitter("/Tests:\"Test(\\\"iCT 256\\\")\"", ["/Tests:\"Test(\\\"iCT 256\\\")\""]);
    }

last touched in #1196 8 years ago when fixing some mysterious other edge cases.

Only affects answer files. Where it fails to interpret \" as the end of the quoted string (it always considers " as isQuoted != isQuoted, and so if any space follows the space will jump out of the inner loop acting as end of token.

Used by TIA and test retry in AzureDevOps.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions