summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTestJS.cpp')
-rw-r--r--unittests/Format/FormatTestJS.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp
index 485ccd624e..7f5507ee26 100644
--- a/unittests/Format/FormatTestJS.cpp
+++ b/unittests/Format/FormatTestJS.cpp
@@ -138,7 +138,7 @@ TEST_F(FormatTestJS, GoogScopes) {
"}); // goog.scope");
}
-TEST_F(FormatTestJS, Closures) {
+TEST_F(FormatTestJS, FunctionLiterals) {
verifyFormat("doFoo(function() { return 1; });");
verifyFormat("var func = function() { return 1; };");
verifyFormat("return {\n"
@@ -177,6 +177,13 @@ TEST_F(FormatTestJS, Closures) {
" a: function() { return 1; }\n"
"};",
getGoogleJSStyleWithColumns(37));
+
+ verifyFormat("return {\n"
+ " a: function SomeFunction() {\n"
+ " // ...\n"
+ " return 1;\n"
+ " }\n"
+ "};");
}
TEST_F(FormatTestJS, MultipleFunctionLiterals) {