diff options
Diffstat (limited to 'clang/unittests/Format')
| -rw-r--r-- | clang/unittests/Format/FormatTestProto.cpp | 9 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTestTextProto.cpp | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index 3889bc67766..d667ec2b3e9 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -412,5 +412,14 @@ TEST_F(FormatTestProto, FormatsImports) { "}"); } +TEST_F(FormatTestProto, KeepsLongStringLiteralsOnSameLine) { + verifyFormat( + "option (MyProto.options) = {\n" + " foo: {\n" + " text: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaa\"\n" + " }\n" + "}"); +} + } // end namespace tooling } // end namespace clang diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp index 1206a2b514e..de9225d35aa 100644 --- a/clang/unittests/Format/FormatTestTextProto.cpp +++ b/clang/unittests/Format/FormatTestTextProto.cpp @@ -306,5 +306,12 @@ TEST_F(FormatTestTextProto, DiscardsUnbreakableTailIfCanBreakAfter) { " }\n" "}"); } + +TEST_F(FormatTestTextProto, KeepsLongStringLiteralsOnSameLine) { + verifyFormat( + "foo: {\n" + " text: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaaaa\"\n" + "}"); +} } // end namespace tooling } // end namespace clang |

