[PATCH] Test for empty .clang-format file.
Alexander Kornienko
alexfh at google.com
Fri Aug 30 11:10:30 PDT 2013
Hi djasper,
Test clang-format's handling of empty .clang-format files.
http://llvm-reviews.chandlerc.com/D1562
Files:
test/Format/style-on-command-line.cpp
Index: test/Format/style-on-command-line.cpp
===================================================================
--- test/Format/style-on-command-line.cpp
+++ test/Format/style-on-command-line.cpp
@@ -5,8 +5,10 @@
// RUN: clang-format -style="{lsjd}" %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK4 %s
// RUN: [ ! -e %T/.clang-format ] || rm %T/.clang-format
// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK5 %s
-// RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %T/.clang-format
+// RUN: printf "\n" > %T/.clang-format
// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s
+// RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %T/.clang-format
+// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK7 %s
void f() {
// CHECK1: {{^ int\* i;$}}
// CHECK2: {{^ int \*i;$}}
@@ -17,7 +19,9 @@
// CHECK4: {{^ int \*i;$}}
// CHECK5: Can't find usable .clang-format, using LLVM style
// CHECK5: {{^ int \*i;$}}
-// CHECK6: {{^ int\* i;$}}
+// CHECK6: Can't find usable .clang-format, using LLVM style
+// CHECK6: {{^ int \*i;$}}
+// CHECK7: {{^ int\* i;$}}
int*i;
int j;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1562.1.patch
Type: text/x-patch
Size: 1265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130830/d1354afb/attachment.bin>
More information about the cfe-commits
mailing list