summaryrefslogtreecommitdiff
path: root/test/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-10 07:47:19 +0000
committerDaniel Jasper <djasper@google.com>2015-05-10 07:47:19 +0000
commiteedbff6b679d9db2e7c1344ee704df2b71469e79 (patch)
treef0569340268b036a336c14707bbb70c31e373332 /test/Format
parent5076698d4dafbfec8a0b304a41518fa6420f9db8 (diff)
Reapply r236854 and fixed r236867.
Makes emacs show a different message when clang-format encountered a syntax error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236943 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..bd2c74ca3c
--- /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 -cursor=0 > %t.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
+// CHECK: {{"IncompleteFormat": true}}
+// CHECK: {{^int\ \i;$}}
+ int i;
+// CHECK: {{^f \( g \(;$}}
+f ( g (;