diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestTextProto.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTestTextProto.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp index 0a7bcdd8236..82da8737a37 100644 --- a/clang/unittests/Format/FormatTestTextProto.cpp +++ b/clang/unittests/Format/FormatTestTextProto.cpp @@ -290,5 +290,17 @@ TEST_F(FormatTestTextProto, SupportsAngleBracketMessageFields) { " product_data <product {1}>\n" ">"); } + +TEST_F(FormatTestTextProto, DiscardsUnbreakableTailIfCanBreakAfter) { + // The two closing braces count towards the string UnbreakableTailLength, but + // since we have broken after the corresponding opening braces, we don't + // consider that length for string breaking. + verifyFormat( + "foo: {\n" + " bar: {\n" + " text: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n" + " }\n" + "}"); +} } // end namespace tooling } // end namespace clang |

