1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2008 Google Inc. All rights reserved. 3 // 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file or at 6 // https://developers.google.com/open-source/licenses/bsd 7 8 // Author: kenton@google.com (Kenton Varda) 9 10 #include "google/protobuf/compiler/java/doc_comment.h" 11 12 #include <gtest/gtest.h> 13 14 namespace google { 15 namespace protobuf { 16 namespace compiler { 17 namespace java { 18 namespace { 19 TEST(JavaDocCommentTest,Escaping)20TEST(JavaDocCommentTest, Escaping) { 21 EXPECT_EQ("foo /* bar */ baz", EscapeJavadoc("foo /* bar */ baz")); 22 EXPECT_EQ("foo /*/ baz", EscapeJavadoc("foo /*/ baz")); 23 EXPECT_EQ("{@foo}", EscapeJavadoc("{@foo}")); 24 EXPECT_EQ("<i>&</i>", EscapeJavadoc("<i>&</i>")); 25 EXPECT_EQ("foo\u1234bar", EscapeJavadoc("foo\\u1234bar")); 26 EXPECT_EQ("@deprecated", EscapeJavadoc("@deprecated")); 27 } 28 29 } // namespace 30 } // namespace java 31 } // namespace compiler 32 } // namespace protobuf 33 } // namespace google 34