AAPT2: Forward @TestApi in resource comments to JavaDoc
Bug: 37894597 Test: make aapt2_tests Change-Id: I357fb84941bfbb3892a8c46feb47f55b865b6649
This commit is contained in:
@@ -34,7 +34,7 @@ TEST(AnnotationProcessorTest, EmitsDeprecated) {
|
||||
processor.AppendComment(comment);
|
||||
|
||||
std::stringstream result;
|
||||
processor.WriteToStream(&result, "");
|
||||
processor.WriteToStream("", &result);
|
||||
std::string annotations = result.str();
|
||||
|
||||
EXPECT_THAT(annotations, HasSubstr("@Deprecated"));
|
||||
@@ -45,7 +45,7 @@ TEST(AnnotationProcessorTest, EmitsSystemApiAnnotationAndRemovesFromComment) {
|
||||
processor.AppendComment("@SystemApi This is a system API");
|
||||
|
||||
std::stringstream result;
|
||||
processor.WriteToStream(&result, "");
|
||||
processor.WriteToStream("", &result);
|
||||
std::string annotations = result.str();
|
||||
|
||||
EXPECT_THAT(annotations, HasSubstr("@android.annotation.SystemApi"));
|
||||
@@ -53,6 +53,19 @@ TEST(AnnotationProcessorTest, EmitsSystemApiAnnotationAndRemovesFromComment) {
|
||||
EXPECT_THAT(annotations, HasSubstr("This is a system API"));
|
||||
}
|
||||
|
||||
TEST(AnnotationProcessorTest, EmitsTestApiAnnotationAndRemovesFromComment) {
|
||||
AnnotationProcessor processor;
|
||||
processor.AppendComment("@TestApi This is a test API");
|
||||
|
||||
std::stringstream result;
|
||||
processor.WriteToStream("", &result);
|
||||
std::string annotations = result.str();
|
||||
|
||||
EXPECT_THAT(annotations, HasSubstr("@android.annotation.TestApi"));
|
||||
EXPECT_THAT(annotations, Not(HasSubstr("@TestApi")));
|
||||
EXPECT_THAT(annotations, HasSubstr("This is a test API"));
|
||||
}
|
||||
|
||||
TEST(AnnotationProcessor, ExtractsFirstSentence) {
|
||||
EXPECT_THAT(AnnotationProcessor::ExtractFirstSentence("This is the only sentence"),
|
||||
Eq("This is the only sentence"));
|
||||
|
||||
Reference in New Issue
Block a user