summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2017-02-28 11:08:24 +0000
committerMartin Probst <martin@probst.io>2017-02-28 11:08:24 +0000
commitbb46a7dd2aa6a725dd2825c2f66a2f61719ba84f (patch)
tree78de8c7ffa0fdded0b103104128777b86dcbe541 /clang/unittests
parent6159f1290ef9e337e4409967ff971f11d3d53e41 (diff)
downloadbcm5719-llvm-bb46a7dd2aa6a725dd2825c2f66a2f61719ba84f.tar.gz
bcm5719-llvm-bb46a7dd2aa6a725dd2825c2f66a2f61719ba84f.zip
Blacklist arbitrary @\\w+ JSDoc tags from wrapping.
Summary: Also limits the blacklisting to only apply when the tag is actually followed by a parameter in curly braces. /** @mods {long.type.must.not.wrap} */ vs /** @const this is a long description that may wrap. */ Reviewers: djasper Subscribers: klimek, krasimir, cfe-commits Differential Revision: https://reviews.llvm.org/D30452 llvm-svn: 296467
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 112b124398b..d6e14edf871 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1575,6 +1575,30 @@ TEST_F(FormatTestJS, JSDocAnnotations) {
" * @export {this.is.a.long.path.to.a.Type}\n"
" */",
getGoogleJSStyleWithColumns(20));
+ verifyFormat("/**\n"
+ " * @mods {this.is.a.long.path.to.a.Type}\n"
+ " */",
+ "/**\n"
+ " * @mods {this.is.a.long.path.to.a.Type}\n"
+ " */",
+ getGoogleJSStyleWithColumns(20));
+ verifyFormat("/**\n"
+ " * @param {this.is.a.long.path.to.a.Type}\n"
+ " */",
+ "/**\n"
+ " * @param {this.is.a.long.path.to.a.Type}\n"
+ " */",
+ getGoogleJSStyleWithColumns(20));
+ verifyFormat(
+ "/**\n"
+ " * @param This is a\n"
+ " * long comment but\n"
+ " * no type\n"
+ " */",
+ "/**\n"
+ " * @param This is a long comment but no type\n"
+ " */",
+ getGoogleJSStyleWithColumns(20));
}
TEST_F(FormatTestJS, RequoteStringsSingle) {
OpenPOWER on IntegriCloud