clang-format: Support case ranges.
Before (note the missing space before "..." which can lead to compile
errors):
switch (x) {
case 'A'... 'Z':
case 1... 5:
break;
}
After:
switch (x) {
case 'A' ... 'Z':
case 1 ... 5:
break;
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193050 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index dcb708e..ad1cf75 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -590,6 +590,14 @@
"});");
}
+TEST_F(FormatTest, CaseRanges) {
+ verifyFormat("switch (x) {\n"
+ "case 'A' ... 'Z':\n"
+ "case 1 ... 5:\n"
+ " break;\n"
+ "}");
+}
+
TEST_F(FormatTest, FormatsLabels) {
verifyFormat("void f() {\n"
" some_code();\n"