]> granicus.if.org Git - clang/commitdiff
clang-format: Add test for (properly escaped) XML output.
authorDaniel Jasper <djasper@google.com>
Sat, 17 Oct 2015 22:44:19 +0000 (22:44 +0000)
committerDaniel Jasper <djasper@google.com>
Sat, 17 Oct 2015 22:44:19 +0000 (22:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250629 91177308-0d34-0410-b5e6-96231b3b80d8

test/Format/xmloutput.cpp [new file with mode: 0644]

diff --git a/test/Format/xmloutput.cpp b/test/Format/xmloutput.cpp
new file mode 100644 (file)
index 0000000..d3c5254
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: clang-format -output-replacements-xml -sort-includes %s > %t.xml
+// RUN: FileCheck -strict-whitespace -input-file=%t.xml %s
+
+// CHECK: <?xml
+// CHECK-NEXT: {{<replacements.*incomplete_format='false'}}
+// CHECK-NEXT: {{<replacement.*#include &lt;a>&#10;#include &lt;b><}}
+// CHECK-NEXT: {{<replacement.*>&#10;<}}
+// CHECK-NEXT: {{<replacement.*> <}}
+#include <b>
+#include <a>
+
+int a;int*b;