diff options
author | Daniel Jasper <djasper@google.com> | 2013-03-25 09:14:25 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-03-25 09:14:25 +0000 |
commit | 0ff72fc9fadcaf6ab867b1457d59e3fdcc9e5bc6 (patch) | |
tree | c7abc0665a744d7fc07d2674fd46a5d550a3cdb2 /test/Format | |
parent | 2de19edab6001d2c17720d02fe0760b9b452192a (diff) |
Re-add clang-format tests to clang/test.
Also now use -strict-whitespace as the tests are confusing otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Format')
-rw-r--r-- | test/Format/basic.cpp | 6 | ||||
-rw-r--r-- | test/Format/diagnostic.cpp | 4 | ||||
-rw-r--r-- | test/Format/ranges.cpp | 11 |
3 files changed, 21 insertions, 0 deletions
diff --git a/test/Format/basic.cpp b/test/Format/basic.cpp new file mode 100644 index 0000000000..375bbd2ec7 --- /dev/null +++ b/test/Format/basic.cpp @@ -0,0 +1,6 @@ +// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp +// RUN: clang-format -i %t.cpp +// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s + +// CHECK: {{^int\ \*i;}} + int * i ; diff --git a/test/Format/diagnostic.cpp b/test/Format/diagnostic.cpp new file mode 100644 index 0000000000..2e930ee5b7 --- /dev/null +++ b/test/Format/diagnostic.cpp @@ -0,0 +1,4 @@ +// RUN: clang-format 2>&1 >/dev/null %s |FileCheck %s + +} +// CHECK: diagnostic.cpp:[[@LINE-1]]:1: error: unexpected '}' diff --git a/test/Format/ranges.cpp b/test/Format/ranges.cpp new file mode 100644 index 0000000000..0244fc195c --- /dev/null +++ b/test/Format/ranges.cpp @@ -0,0 +1,11 @@ +// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp +// RUN: clang-format -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; + +// CHECK: {{^\ \ int\ \ \*\ \ i;$}} + int * i; + +// CHECK: {{^\ \ int\ \*i;$}} + int * i; |