diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 36c3dd08cba..75b53a57879 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -315,6 +315,15 @@ TEST_F(FormatTestJS, GoogModules) { " goog.module.get('my.long.module.name.followedBy.MyLongClassName');"); } +TEST_F(FormatTestJS, FormatsNamespaces) { + verifyFormat("namespace Foo {\n" + " export let x = 1;\n" + "}\n"); + verifyFormat("declare namespace Foo {\n" + " export let x: number;\n" + "}\n"); +} + TEST_F(FormatTestJS, FormatsFreestandingFunctions) { verifyFormat("function outer1(a, b) {\n" " function inner1(a, b) { return a; }\n" |

