summaryrefslogtreecommitdiffstats
path: root/test/Format
diff options
context:
space:
mode:
Diffstat (limited to 'test/Format')
-rw-r--r--test/Format/basic.cpp2
-rw-r--r--test/Format/multiple-inputs-error.cpp6
-rw-r--r--test/Format/multiple-inputs-inplace.cpp8
-rw-r--r--test/Format/multiple-inputs.cpp7
-rw-r--r--test/Format/ranges.cpp2
5 files changed, 23 insertions, 2 deletions
diff --git a/test/Format/basic.cpp b/test/Format/basic.cpp
index 375bbd2..a12866b 100644
--- a/test/Format/basic.cpp
+++ b/test/Format/basic.cpp
@@ -1,5 +1,5 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
-// RUN: clang-format -i %t.cpp
+// RUN: clang-format -style=LLVM -i %t.cpp
// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
// CHECK: {{^int\ \*i;}}
diff --git a/test/Format/multiple-inputs-error.cpp b/test/Format/multiple-inputs-error.cpp
new file mode 100644
index 0000000..71f87e0
--- /dev/null
+++ b/test/Format/multiple-inputs-error.cpp
@@ -0,0 +1,6 @@
+// RUN: cp %s %t-1.cpp
+// RUN: cp %s %t-2.cpp
+// RUN: clang-format 2>&1 >/dev/null -offset=1 -length=0 %t-1.cpp %t-2.cpp |FileCheck %s
+// CHECK: error: "-offset" and "-length" can only be used for single file.
+
+int i ;
diff --git a/test/Format/multiple-inputs-inplace.cpp b/test/Format/multiple-inputs-inplace.cpp
new file mode 100644
index 0000000..74c30db
--- /dev/null
+++ b/test/Format/multiple-inputs-inplace.cpp
@@ -0,0 +1,8 @@
+// RUN: cp %s %t-1.cpp
+// RUN: cp %s %t-2.cpp
+// RUN: clang-format -style=LLVM -i %t-1.cpp %t-2.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t-1.cpp %s
+// RUN: FileCheck -strict-whitespace -input-file=%t-2.cpp %s
+
+// CHECK: {{^int\ \*i;}}
+ int * i ;
diff --git a/test/Format/multiple-inputs.cpp b/test/Format/multiple-inputs.cpp
new file mode 100644
index 0000000..df26714
--- /dev/null
+++ b/test/Format/multiple-inputs.cpp
@@ -0,0 +1,7 @@
+// RUN: cp %s %t-1.cpp
+// RUN: cp %s %t-2.cpp
+// RUN: clang-format -style=LLVM %t-1.cpp %t-2.cpp|FileCheck -strict-whitespace %s
+
+// CHECK: {{^int\ \*i;}}
+// CHECK: {{^int\ \*i;}}
+ int * i ;
diff --git a/test/Format/ranges.cpp b/test/Format/ranges.cpp
index 0244fc1..c7fdd4b 100644
--- a/test/Format/ranges.cpp
+++ b/test/Format/ranges.cpp
@@ -1,5 +1,5 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
-// RUN: clang-format -offset=2 -length=0 -offset=28 -length=0 -i %t.cpp
+// RUN: clang-format -style=LLVM -offset=2 -length=0 -offset=28 -length=0 -i %t.cpp
// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
// CHECK: {{^int\ \*i;$}}
int*i;
OpenPOWER on IntegriCloud