summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-20 16:56:16 +0000
committerDaniel Jasper <djasper@google.com>2013-10-20 16:56:16 +0000
commit2d0cd4978737bdde886d70cb82d5ce8fb385bfa2 (patch)
treecaf5392d9a6f5e55a776af140211503c7f76868e /clang/unittests/Format/FormatTest.cpp
parentd489dd342bfdc2481a62633c8f8d66d6e2339dcb (diff)
downloadbcm5719-llvm-2d0cd4978737bdde886d70cb82d5ce8fb385bfa2.tar.gz
bcm5719-llvm-2d0cd4978737bdde886d70cb82d5ce8fb385bfa2.zip
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; } llvm-svn: 193050
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index dcb708e0d78..ad1cf75392b 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -590,6 +590,14 @@ TEST_F(FormatTest, FormatsSwitchStatement) {
"});");
}
+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"
OpenPOWER on IntegriCloud