aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2012-12-04 14:46:19 +0000
committerAlexander Kornienko <alexfh@google.com>2012-12-04 14:46:19 +0000
commita166e73d39d2f554d0f35f94c9804284d1ff804a (patch)
treefd6d15315ea36e25e5d99d626d8e8278e06f35c6 /unittests/Format/FormatTest.cpp
parent8cb9bf577e3cfe31f1f023ed3a978d726f136edc (diff)
Enum formatting implementation
Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D161 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169272 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index f64ea4acd6..e21367bb31 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -244,6 +244,21 @@ TEST_F(FormatTest, DoWhile) {
"while (something());");
}
+TEST_F(FormatTest, Enum) {
+ verifyFormat("enum {\n"
+ " Zero,\n"
+ " One = 1,\n"
+ " Two = One + 1,\n"
+ " Three = (One + Two),\n"
+ " Four = (Zero && (One ^ Two)) | (One << Two),\n"
+ " Five = (One, Two, Three, Four, 5)\n"
+ "};");
+ verifyFormat("enum Enum {\n"
+ "};");
+ verifyFormat("enum {\n"
+ "};");
+}
+
TEST_F(FormatTest, BreaksDesireably) {
verifyFormat("if (aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n"
" aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa) ||\n"