diff options
author | Daniel Norman <danielnorman@google.com> | 2020-08-31 12:05:49 -0700 |
---|---|---|
committer | Bill Peckham <bpeckham@google.com> | 2020-09-09 10:21:03 -0700 |
commit | 8abdf0e95a5d15a310b6df69d33a4510a0b44b4a (patch) | |
tree | f0c990be5370711e157b2e9e5ae746cb1af915b9 /tools/aapt2/java/AnnotationProcessor_test.cpp | |
parent | 93e6c963c3228074d0e0dd5f3f8d057d9bd11e05 (diff) | |
parent | 6997558ebbaa0c3e5708246807239f11e70ad35d (diff) |
Merge SP1A.200727.001
Change-Id: Ibb86a528ed692cde325705779c7fa57e4b4de682
Diffstat (limited to 'tools/aapt2/java/AnnotationProcessor_test.cpp')
-rw-r--r-- | tools/aapt2/java/AnnotationProcessor_test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/aapt2/java/AnnotationProcessor_test.cpp b/tools/aapt2/java/AnnotationProcessor_test.cpp index 7d0a4e9af632..6bc8902a6dcf 100644 --- a/tools/aapt2/java/AnnotationProcessor_test.cpp +++ b/tools/aapt2/java/AnnotationProcessor_test.cpp @@ -91,6 +91,21 @@ TEST(AnnotationProcessorTest, EmitsTestApiAnnotationAndRemovesFromComment) { EXPECT_THAT(annotations, HasSubstr("This is a test API")); } +TEST(AnnotationProcessorTest, NotEmitSystemApiAnnotation) { + AnnotationProcessor processor; + processor.AppendComment("@SystemApi This is a system API"); + + std::string annotations; + StringOutputStream out(&annotations); + Printer printer(&out); + processor.Print(&printer, true /* strip_api_annotations */); + out.Flush(); + + EXPECT_THAT(annotations, Not(HasSubstr("@android.annotation.SystemApi"))); + EXPECT_THAT(annotations, Not(HasSubstr("@SystemApi"))); + EXPECT_THAT(annotations, HasSubstr("This is a system API")); +} + TEST(AnnotationProcessor, ExtractsFirstSentence) { EXPECT_THAT(AnnotationProcessor::ExtractFirstSentence("This is the only sentence"), Eq("This is the only sentence")); |