Skip to content

Commit

Permalink
Merge pull request #61180 from CyrusNajmabadi/stringCopyPaste6
Browse files Browse the repository at this point in the history
Switch smart-copy-paste tests to use raw-string-literals.
  • Loading branch information
CyrusNajmabadi authored May 9, 2022
2 parents f124c09 + c96594e commit a22346b
Show file tree
Hide file tree
Showing 16 changed files with 9,724 additions and 5,053 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,79 +15,127 @@ public void TestNewLineIntoNormalString1()
{
TestPasteUnknownSource(
pasteText: "\n",
@"var x = ""[||]""",
@"var x = ""\n[||]""",
"""
var x = "[||]"
""",
"""
var x = "\n[||]"
""",
afterUndo: "var x = \"\n[||]\"");
}

[WpfFact]
public void TestNewLineIntoNormalString2()
{
TestPasteUnknownSource(
pasteText: "\r\n",
@"var x = ""[||]""",
@"var x = ""\r\n[||]""",
afterUndo: "var x = \"\r\n[||]\"");
pasteText: """
""",
"""
var x = "[||]"
""",
"""
var x = "\r\n[||]"
""",
afterUndo: """
var x = "
[||]"
""");
}

[WpfFact]
public void TestTabIntoNormalString1()
{
TestPasteUnknownSource(
pasteText: "\t",
@"var x = ""[||]""",
@"var x = ""\t[||]""",
"""
var x = "[||]"
""",
"""
var x = "\t[||]"
""",
afterUndo: "var x = \"\t[||]\"");
}

[WpfFact]
public void TestBackslashTIntoNormalString1()
{
TestPasteUnknownSource(
pasteText: @"\t",
@"var x = ""[||]""",
@"var x = ""\t[||]""",
afterUndo: @"var x = ""[||]""");
pasteText: """\t""",
"""
var x = "[||]"
""",
"""
var x = "\t[||]"
""",
afterUndo: """
var x = "[||]"
""");
}

[WpfFact]
public void TestSingleQuoteIntoNormalString()
{
TestPasteUnknownSource(
pasteText: "'",
@"var x = ""[||]""",
@"var x = ""'[||]""",
afterUndo: "var x = \"[||]\"");
pasteText: """'""",
"""
var x = "[||]"
""",
"""
var x = "'[||]"
""",
afterUndo: """
var x = "[||]"
""");
}

[WpfFact]
public void TestDoubleQuoteIntoNormalString()
{
TestPasteUnknownSource(
pasteText: "\"",
@"var x = ""[||]""",
@"var x = ""\""[||]""",
afterUndo: "var x = \"\"[||]\"");
pasteText: """
"
""",
"""
var x = "[||]"
""",
"""
var x = "\"[||]"
""",
afterUndo: """
var x = ""[||]"
""");
}

[WpfFact]
public void TestComplexStringIntoNormalString()
{
TestPasteUnknownSource(
pasteText: "\t\"\"\t",
@"var x = ""[||]""",
@"var x = ""\t\""\""\t[||]""",
"""
var x = "[||]"
""",
"""
var x = "\t\"\"\t[||]"
""",
afterUndo: "var x = \"\t\"\"\t[||]\"");
}

[WpfFact]
public void TestNormalTextIntoNormalString()
{
TestPasteUnknownSource(
pasteText: "abc",
@"var x = ""[||]""",
@"var x = ""abc[||]""",
afterUndo: @"var x = ""[||]""");
pasteText: """abc""",
"""
var x = "[||]"
""",
"""
var x = "abc[||]"
""",
afterUndo: """
var x = "[||]"
""");
}
}
}
Loading

0 comments on commit a22346b

Please sign in to comment.