diff options
author | Zachary Turner <zturner@google.com> | 2018-10-12 16:31:20 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-10-12 16:31:20 +0000 |
commit | 9f169afab22b7334739c9de0ea1a1ab1ee0c357e (patch) | |
tree | 229ee75795d586e7e7d8f49238a6ce903a1f273b /clang/unittests/Tooling/ReplacementsYamlTest.cpp | |
parent | 9c544199cfd74acdf8b049ff120032a26142e8a2 (diff) | |
download | bcm5719-llvm-9f169afab22b7334739c9de0ea1a1ab1ee0c357e.tar.gz bcm5719-llvm-9f169afab22b7334739c9de0ea1a1ab1ee0c357e.zip |
Make YAML quote forward slashes.
If you have the string /usr/bin, prior to this patch it would not
be quoted by our YAML serializer. But a string like C:\src would
be, due to the presence of a backslash. This makes the quoting
rules of basically every single file path different depending on
the path syntax (posix vs. Windows).
While technically not required by the YAML specification to quote
forward slashes, when the behavior of paths is inconsistent it
makes it difficult to portably write FileCheck lines that will
work with either kind of path.
Differential Revision: https://reviews.llvm.org/D53169
llvm-svn: 344359
Diffstat (limited to 'clang/unittests/Tooling/ReplacementsYamlTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/ReplacementsYamlTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/unittests/Tooling/ReplacementsYamlTest.cpp b/clang/unittests/Tooling/ReplacementsYamlTest.cpp index 3e4193d2adf..2e5a87a931d 100644 --- a/clang/unittests/Tooling/ReplacementsYamlTest.cpp +++ b/clang/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" |