From: Zachary Turner Date: Fri, 12 Oct 2018 16:24:09 +0000 (+0000) Subject: Make YAML quote forward slashes. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be74d0ad793c1cbc84b4f8b3ce9c95ac45cd9074;p=clang Make YAML quote forward slashes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344357 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Tooling/DiagnosticsYamlTest.cpp b/unittests/Tooling/DiagnosticsYamlTest.cpp index 83e09eaeef..18284bd995 100644 --- a/unittests/Tooling/DiagnosticsYamlTest.cpp +++ b/unittests/Tooling/DiagnosticsYamlTest.cpp @@ -58,30 +58,30 @@ TEST(DiagnosticsYamlTest, serializesDiagnostics) { YAML << TUD; EXPECT_EQ("---\n" - "MainSourceFile: path/to/source.cpp\n" + "MainSourceFile: 'path/to/source.cpp'\n" "Diagnostics: \n" " - DiagnosticName: 'diagnostic#1\'\n" " Message: 'message #1'\n" " FileOffset: 55\n" - " FilePath: path/to/source.cpp\n" + " FilePath: 'path/to/source.cpp'\n" " Replacements: \n" - " - FilePath: path/to/source.cpp\n" + " - FilePath: 'path/to/source.cpp'\n" " Offset: 100\n" " Length: 12\n" " ReplacementText: 'replacement #1'\n" " - DiagnosticName: 'diagnostic#2'\n" " Message: 'message #2'\n" " FileOffset: 60\n" - " FilePath: path/to/header.h\n" + " FilePath: 'path/to/header.h'\n" " Replacements: \n" - " - FilePath: path/to/header.h\n" + " - FilePath: 'path/to/header.h'\n" " Offset: 62\n" " Length: 2\n" " ReplacementText: 'replacement #2'\n" " - DiagnosticName: 'diagnostic#3'\n" " Message: 'message #3'\n" " FileOffset: 72\n" - " FilePath: path/to/source2.cpp\n" + " FilePath: 'path/to/source2.cpp'\n" " Replacements: \n" "...\n", YamlContentStream.str()); diff --git a/unittests/Tooling/ReplacementsYamlTest.cpp b/unittests/Tooling/ReplacementsYamlTest.cpp index 3e4193d2ad..2e5a87a931 100644 --- a/unittests/Tooling/ReplacementsYamlTest.cpp +++ b/unittests/Tooling/ReplacementsYamlTest.cpp @@ -33,13 +33,13 @@ TEST(ReplacementsYamlTest, serializesReplacements) { // NOTE: If this test starts to fail for no obvious reason, check whitespace. ASSERT_STREQ("---\n" - "MainSourceFile: /path/to/source.cpp\n" + "MainSourceFile: '/path/to/source.cpp'\n" "Replacements: \n" // Extra whitespace here! - " - FilePath: /path/to/file1.h\n" + " - FilePath: '/path/to/file1.h'\n" " Offset: 232\n" " Length: 56\n" " ReplacementText: 'replacement #1'\n" - " - FilePath: /path/to/file2.h\n" + " - FilePath: '/path/to/file2.h'\n" " Offset: 301\n" " Length: 2\n" " ReplacementText: 'replacement #2'\n"