Repository: dotnet/roslyn
File: src/EditorFeatures/CSharpTest/SplitStringLiteral/SplitStringLiteralCommandHandlerTests.cs (C#)

Code before:
                void M()
                {
                    var v = "now is " +
                        "the ti" +
                        "me";
                }
            }
            """;

        var actualText = textBuffer.CurrentSnapshot.AsText().ToString();
        Assert.Equal(expectedOutput, actualText);

        // Find the expected caret positions in the output
        var firstCaretPosition = actualText.IndexOf("\"the ti\"");
        var secondCaretPosition = actualText.IndexOf("\"me\"");

        Assert.True(firstCaretPosition > 0);
        Assert.True(secondCaretPosition > 0);

        // Verify selections are at the start of the continuation strings
        var firstSelection = selections[0];
        var secondSelection = selections[1];

        // The carets should be right after the opening quotes of the continuation strings
        Assert.True(firstSelection.Start.Position >= firstCaretPosition && firstSelection.Start.Position <= firstCaretPosition + 10);
        Assert.True(secondSelection.Start.Position >= secondCaretPosition && secondSelection.Start.Position <= secondCaretPosition + 10);
    }

    [WpfFact, WorkItem("https://github.com/dotnet/roslyn/issues/40277")]
    public void TestInStringWithKeepTabsEnabled1()
        => TestHandled(
            """
            class C
            {
            	void M()
            	{
            		var s = "Hello [||]world";
            	}
            }
            """,
            """
            class C
            {
            	void M()
            	{
            		var s = "Hello " +
            			"[||]world";
            	}
            }
            """,
            useTabs: true);

Review comment (refactor):
@copilot instead of manually computing the positions, put them in the expectedOutput with `[||]` markers as well.  Then use the MarkupTestFile helpers to extract out the text content and caret positions of the expected outcome to validate against. 

Code after:
            	void M()
            	{
            		var s = "Hello " +
            			"[||]world";
            	}
            }
            """,
            useTabs: true);

    [WpfFact, WorkItem("https://github.com/dotnet/roslyn/issues/40277")]
    public void TestInStringWithKeepTabsEnabled2()
        => TestHandled(
            """
            class C
            {
            	void M()
            	{
            		var s = "Hello " +
            			"there [||]world";
            	}
            }
            """,
            """
            class C
            {
            	void M()
            	{
            		var s = "Hello " +
            			"there " +
            			"[||]world";
            	}
            }
            """,
            useTabs: true);

    [WpfFact]
    public void TestMissingInRawStringLiteral()
        => TestNotHandled(
            """"
            class C
            {
                void M()
                {
                    var v = """Hello[||]there
            world
            """;
                }
            }
            """");

    [WpfFact]