From ea5d5e7efcd6e375ab3c0548e217dbb6bd0a7040 Mon Sep 17 00:00:00 2001 From: Marco Pennekamp Date: Wed, 8 Feb 2023 19:13:14 +0100 Subject: [PATCH] [kotlin] KTIJ-24485 Add tests for "redundant visibility modifier" inspection in explicit API mode GitOrigin-RevId: 264ca542d6dec38512a77ee9da40ab449f661869 --- .../tests/K2LocalInspectionTestGenerated.java | 30 +++++++++++++++++++ .../LocalInspectionTestGenerated.java | 30 +++++++++++++++++++ .../publicExplicitApiModeStrict.kt | 6 ++++ .../publicExplicitApiModeStrict2.kt | 6 ++++ .../publicExplicitApiModeStrict3.kt | 5 ++++ .../publicExplicitApiModeStrict3.kt.after | 5 ++++ .../publicExplicitApiModeWarning.kt | 6 ++++ .../publicExplicitApiModeWarning2.kt | 6 ++++ .../publicExplicitApiModeWarning3.kt | 5 ++++ .../publicExplicitApiModeWarning3.kt.after | 5 ++++ 10 files changed, 104 insertions(+) create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict.kt create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict2.kt create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt.after create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning.kt create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning2.kt create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt create mode 100644 plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt.after diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/test/org/jetbrains/kotlin/idea/k2/inspections/tests/K2LocalInspectionTestGenerated.java b/plugins/kotlin/code-insight/inspections-k2/tests/test/org/jetbrains/kotlin/idea/k2/inspections/tests/K2LocalInspectionTestGenerated.java index 7c2f72d3e2e7..08dd3064dc80 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/test/org/jetbrains/kotlin/idea/k2/inspections/tests/K2LocalInspectionTestGenerated.java +++ b/plugins/kotlin/code-insight/inspections-k2/tests/test/org/jetbrains/kotlin/idea/k2/inspections/tests/K2LocalInspectionTestGenerated.java @@ -113,6 +113,36 @@ public abstract class K2LocalInspectionTestGenerated extends AbstractK2LocalInsp runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/protectedIsDefaultForSealedConstructor.kt"); } + @TestMetadata("publicExplicitApiModeStrict.kt") + public void testPublicExplicitApiModeStrict() throws Exception { + runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict.kt"); + } + + @TestMetadata("publicExplicitApiModeStrict2.kt") + public void testPublicExplicitApiModeStrict2() throws Exception { + runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict2.kt"); + } + + @TestMetadata("publicExplicitApiModeStrict3.kt") + public void testPublicExplicitApiModeStrict3() throws Exception { + runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt"); + } + + @TestMetadata("publicExplicitApiModeWarning.kt") + public void testPublicExplicitApiModeWarning() throws Exception { + runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning.kt"); + } + + @TestMetadata("publicExplicitApiModeWarning2.kt") + public void testPublicExplicitApiModeWarning2() throws Exception { + runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning2.kt"); + } + + @TestMetadata("publicExplicitApiModeWarning3.kt") + public void testPublicExplicitApiModeWarning3() throws Exception { + runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt"); + } + @TestMetadata("publicOverrideProtectedSetter.kt") public void testPublicOverrideProtectedSetter() throws Exception { runTest("../../../idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicOverrideProtectedSetter.kt"); diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java index 39a94769a895..26efac65ad5e 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java @@ -10562,6 +10562,36 @@ public abstract class LocalInspectionTestGenerated extends AbstractLocalInspecti runTest("testData/inspectionsLocal/redundantVisibilityModifier/protectedIsDefaultForSealedConstructor.kt"); } + @TestMetadata("publicExplicitApiModeStrict.kt") + public void testPublicExplicitApiModeStrict() throws Exception { + runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict.kt"); + } + + @TestMetadata("publicExplicitApiModeStrict2.kt") + public void testPublicExplicitApiModeStrict2() throws Exception { + runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict2.kt"); + } + + @TestMetadata("publicExplicitApiModeStrict3.kt") + public void testPublicExplicitApiModeStrict3() throws Exception { + runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt"); + } + + @TestMetadata("publicExplicitApiModeWarning.kt") + public void testPublicExplicitApiModeWarning() throws Exception { + runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning.kt"); + } + + @TestMetadata("publicExplicitApiModeWarning2.kt") + public void testPublicExplicitApiModeWarning2() throws Exception { + runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning2.kt"); + } + + @TestMetadata("publicExplicitApiModeWarning3.kt") + public void testPublicExplicitApiModeWarning3() throws Exception { + runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt"); + } + @TestMetadata("publicOverrideProtectedSetter.kt") public void testPublicOverrideProtectedSetter() throws Exception { runTest("testData/inspectionsLocal/redundantVisibilityModifier/publicOverrideProtectedSetter.kt"); diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict.kt new file mode 100644 index 000000000000..5916e669fba6 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict.kt @@ -0,0 +1,6 @@ +// PROBLEM: none +// COMPILER_ARGUMENTS: -Xexplicit-api=strict + +public abstract class A { + public abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict2.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict2.kt new file mode 100644 index 000000000000..214fed00af38 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict2.kt @@ -0,0 +1,6 @@ +// PROBLEM: none +// COMPILER_ARGUMENTS: -Xexplicit-api=strict + +public abstract class A { + public abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt new file mode 100644 index 000000000000..0e74c0ab10df --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt @@ -0,0 +1,5 @@ +// COMPILER_ARGUMENTS: -Xexplicit-api=strict + +private abstract class A { + public abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt.after new file mode 100644 index 000000000000..e33842e3bb67 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeStrict3.kt.after @@ -0,0 +1,5 @@ +// COMPILER_ARGUMENTS: -Xexplicit-api=strict + +private abstract class A { + abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning.kt new file mode 100644 index 000000000000..c32142662f53 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning.kt @@ -0,0 +1,6 @@ +// PROBLEM: none +// COMPILER_ARGUMENTS: -Xexplicit-api=warning + +public abstract class A { + public abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning2.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning2.kt new file mode 100644 index 000000000000..88352ca7ac02 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning2.kt @@ -0,0 +1,6 @@ +// PROBLEM: none +// COMPILER_ARGUMENTS: -Xexplicit-api=warning + +public abstract class A { + public abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt new file mode 100644 index 000000000000..aeed9d09a894 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt @@ -0,0 +1,5 @@ +// COMPILER_ARGUMENTS: -Xexplicit-api=warning + +private abstract class A { + public abstract fun test() +} diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt.after new file mode 100644 index 000000000000..7a25f6c0fc21 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantVisibilityModifier/publicExplicitApiModeWarning3.kt.after @@ -0,0 +1,5 @@ +// COMPILER_ARGUMENTS: -Xexplicit-api=warning + +private abstract class A { + abstract fun test() +}