summaryrefslogtreecommitdiff
path: root/test/Format
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2015-05-08 13:59:15 +0000
committerManuel Klimek <klimek@google.com>2015-05-08 13:59:15 +0000
commit49906612428c186bccb57a8d3c61739eb7fbc305 (patch)
tree63188cca500a7f7801f94ad49e0b6664fba82663 /test/Format
parent04822968f375ac612ec771d291c034b158ba0e23 (diff)
Make emacs show when clang-format encountered a syntax error.
Propagate the 'incomplete-format' state back through clang-format's command line interace and adapt the emacs integration to show a better result. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Format')
-rw-r--r--test/Format/cursor.cpp2
-rw-r--r--test/Format/incomplete.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/test/Format/cursor.cpp b/test/Format/cursor.cpp
index d9aab5acb6..c7d576ba6e 100644
--- a/test/Format/cursor.cpp
+++ b/test/Format/cursor.cpp
@@ -1,6 +1,6 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t2.cpp
// RUN: clang-format -style=LLVM %t2.cpp -cursor=6 > %t.cpp
// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
-// CHECK: {{^\{ "Cursor": 4 \}$}}
+// CHECK: {{^\{ "Cursor": 4, }}
// CHECK: {{^int\ \i;$}}
int i;
diff --git a/test/Format/incomplete.cpp b/test/Format/incomplete.cpp
new file mode 100644
index 0000000000..ade38b66a3
--- /dev/null
+++ b/test/Format/incomplete.cpp
@@ -0,0 +1,8 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t2.cpp
+// RUN: clang-format -style=LLVM %t2.cpp > %t.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
+// CHECK: {{^\{ "IncompleteFormat": true }}
+// CHECK: {{^int\ \i;$}}
+ int i;
+// CHECK: {{^f \( g \(;$}}
+f ( g (;