[FIR] Add a test for KT-26045
^KT-26045 Fixed Merge-request: KT-MR-13023 Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
951830fcef
commit
9e57aba448
+6
@@ -58,6 +58,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("addTestForFalsePositiveDuplicateLabelInWhen.kt")
|
||||||
|
public void testAddTestForFalsePositiveDuplicateLabelInWhen() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/addTestForFalsePositiveDuplicateLabelInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTests() throws Exception {
|
public void testAllFilesPresentInTests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||||
|
|||||||
+6
@@ -58,6 +58,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("addTestForFalsePositiveDuplicateLabelInWhen.kt")
|
||||||
|
public void testAddTestForFalsePositiveDuplicateLabelInWhen() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/addTestForFalsePositiveDuplicateLabelInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTests() throws Exception {
|
public void testAllFilesPresentInTests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||||
|
|||||||
+6
@@ -58,6 +58,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("addTestForFalsePositiveDuplicateLabelInWhen.kt")
|
||||||
|
public void testAddTestForFalsePositiveDuplicateLabelInWhen() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/addTestForFalsePositiveDuplicateLabelInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTests() throws Exception {
|
public void testAllFilesPresentInTests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
|
||||||
|
|||||||
+6
@@ -58,6 +58,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("addTestForFalsePositiveDuplicateLabelInWhen.kt")
|
||||||
|
public void testAddTestForFalsePositiveDuplicateLabelInWhen() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/addTestForFalsePositiveDuplicateLabelInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTests() throws Exception {
|
public void testAllFilesPresentInTests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
|
||||||
|
|||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
// ISSUE: KT-26045
|
||||||
|
|
||||||
|
class _Class {
|
||||||
|
val prop_1 = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun case_1(value: Int?, value1: _Class, value2: _Class?) {
|
||||||
|
when (value) {
|
||||||
|
value1.prop_1, value2?.prop_1 -> {}
|
||||||
|
10 -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// ISSUE: KT-26045
|
||||||
|
|
||||||
|
class _Class {
|
||||||
|
val prop_1 = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun case_1(value: Int?, value1: _Class, value2: _Class?) {
|
||||||
|
when (value) {
|
||||||
|
value1.prop_1, <!DUPLICATE_LABEL_IN_WHEN!>value2?.prop_1<!> -> {}
|
||||||
|
10 -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -58,6 +58,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
runTest("compiler/testData/diagnostics/tests/AbstractInTrait.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("addTestForFalsePositiveDuplicateLabelInWhen.kt")
|
||||||
|
public void testAddTestForFalsePositiveDuplicateLabelInWhen() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/addTestForFalsePositiveDuplicateLabelInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTests() throws Exception {
|
public void testAllFilesPresentInTests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user