diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.exceptions.compiletime.txt new file mode 100644 index 00000000000..8f0873a76c0 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: OPERATOR_MODIFIER_REQUIRED: 'operator' modifier is required on 'compareTo' in 'A' (24,17) in /2.1.kt diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.kt new file mode 100644 index 00000000000..3ef943a0bb3 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.kt @@ -0,0 +1,26 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 1 -> sentence 2 + * NUMBER: 1 + * DESCRIPTION: expressions, comparison-expressions -> paragraph 1 -> sentence 2 + * EXCEPTION: compiletime + */ +class A(val a: Int) { + var isCompared = false + fun compareTo(other: A): Int = run { + isCompared = true + this.a - other.a + } +} + +fun box() { + val a3 = A(-1) + val a4 = A(-3) + + val x = (a3 > a4) +} + diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.1.kt new file mode 100644 index 00000000000..47172f859d9 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.1.kt @@ -0,0 +1,32 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 1 -> sentence 2 + * RELEVANT PLACES: expressions, comparison-expressions -> paragraph 1 -> sentence 1 + * expressions, comparison-expressions -> paragraph 2 -> sentence 1 + * expressions, comparison-expressions -> paragraph 3 -> sentence 1 + * expressions, comparison-expressions -> paragraph 4 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: These operators are overloadable (A < B) + */ + +//A < B is exactly the same as integerLess(A.compareTo(B), 0) +fun box(): String { + val a1 = A(-1) + val a2 = A(3) + if (a1 < a2) + if (a1.isCompared && !a2.isCompared) + return "OK" + return "NOK" +} + +class A(val a: Int) { + var isCompared = false + operator fun compareTo(other: A): Int = run { + isCompared = true + this.a - other.a + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.2.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.2.kt new file mode 100644 index 00000000000..57110f07e7e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.2.kt @@ -0,0 +1,32 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 1 -> sentence 2 + * RELEVANT PLACES: expressions, comparison-expressions -> paragraph 1 -> sentence 1 + * expressions, comparison-expressions -> paragraph 2 -> sentence 2 + * expressions, comparison-expressions -> paragraph 3 -> sentence 1 + * expressions, comparison-expressions -> paragraph 4 -> sentence 1 + * NUMBER: 2 + * DESCRIPTION: These operators are overloadable (A > B) + */ + +//A > B is exactly the same as integerLess(0, A.compareTo(B)) +fun box(): String { + val a1 = A(-1) + val a2 = A(-3) + if (a1 > a2) + if (a1.isCompared && !a2.isCompared) + return "OK" + return "NOK" +} + +class A(val a: Int) { + var isCompared = false + operator fun compareTo(other: A): Int = run { + isCompared = true + this.a - other.a + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.3.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.3.kt new file mode 100644 index 00000000000..97794d7a9d5 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.3.kt @@ -0,0 +1,36 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 1 -> sentence 2 + * RELEVANT PLACES: expressions, comparison-expressions -> paragraph 1 -> sentence 1 + * expressions, comparison-expressions -> paragraph 2 -> sentence 3 + * expressions, comparison-expressions -> paragraph 3 -> sentence 1 + * expressions, comparison-expressions -> paragraph 4 -> sentence 1 + * NUMBER: 3 + * DESCRIPTION: These operators are overloadable (A <= B) + */ + +//A <= B is exactly the same as !integerLess(A.compareTo(B),0) +fun box(): String { + val a1 = A(1) + val a2 = A(3) + + val aa1 = A(0) + val aa2 = A(0) + + if (a1 <= a2 && a1.isCompared && !a2.isCompared) + if (aa1 <= aa2 && aa1.isCompared && !aa2.isCompared) + return "OK" + return "NOK" +} + +class A(val a: Int) { + var isCompared = false + operator fun compareTo(other: A): Int = run { + isCompared = true + this.a - other.a + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.4.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.4.kt new file mode 100644 index 00000000000..be31923b31c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.4.kt @@ -0,0 +1,36 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 1 -> sentence 2 + * RELEVANT PLACES: expressions, comparison-expressions -> paragraph 1 -> sentence 1 + * expressions, comparison-expressions -> paragraph 2 -> sentence 3 + * expressions, comparison-expressions -> paragraph 3 -> sentence 1 + * expressions, comparison-expressions -> paragraph 4 -> sentence 1 + * NUMBER: 4 + * DESCRIPTION: These operators are overloadable (A >= B) + */ + +// A >= B is exactly the same as !integerLess(0, A.compareTo(B)) +fun box(): String { + val a1 = A(10) + val a2 = A(3) + + val aa1 = A(0) + val aa2 = A(0) + + if (a1 >= a2) if (a1.isCompared && !a2.isCompared) + if (aa1 >= aa2) if (aa1.isCompared && !aa2.isCompared) + return "OK" + return "NOK" +} + +class A(val a: Int) { + var isCompared = false + operator fun compareTo(other: A): Int = run { + isCompared = true + this.a - other.a + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/testsMap.json new file mode 100644 index 00000000000..3dc60065261 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/testsMap.json @@ -0,0 +1,72 @@ +{ + "1": { + "neg": { + "2": [ + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "expressions, comparison-expressions -\u003e paragraph 1 -\u003e sentence 2", + "unexpectedBehaviour": false + } + ] + }, + "pos": { + "2": [ + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003c B)", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003e\u003d B)", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003c\u003d B)", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003e B)", + "unexpectedBehaviour": false + } + ], + "1": [ + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003c B)", + "path": "compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003e\u003d B)", + "path": "compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.4.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003c\u003d B)", + "path": "compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.3.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-218", + "casesNumber": 0, + "description": "These operators are overloadable (A \u003e B)", + "path": "compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.2.kt", + "unexpectedBehaviour": false + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg/1.1.kt new file mode 100644 index 00000000000..83e80cd8d14 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg/1.1.kt @@ -0,0 +1,86 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 4 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: The compareTo operator function must have return type kotlin.Int + */ + +// TESTCASE NUMBER: 1 +class Case1(val a: Int) { + var isCompared = false + operator fun compareTo(other: Case1):Any = run{ + TODO() + } +} + +fun case1() { + val a3 = Case1(-1) + val a4 = Case1(-3) + + val x0 = a3 > a4 + val x1 = a3 < a4 + val x2 = a3 >= a4 + val x3 = a3 <= a4 +} + + +// TESTCASE NUMBER: 2 +class Case2(val a: Int) { + var isCompared = false + operator fun compareTo(other: Case2): Nothing = run { + TODO() + } +} + +fun case2() { + val a3 = Case2(-1) + val a4 = Case2(-3) + + val x0 = a3 > a4 + val x1 = a3 < a4 + val x2 = a3 >= a4 + val x3 = a3 <= a4 +} + + +// TESTCASE NUMBER: 3 +class Case3(val a: Int) { + var isCompared = false + operator fun compareTo(other: Case3):Long = run{ + TODO() + } +} + +fun case3() { + val a3 = Case3(-1) + val a4 = Case3(-3) + + val x0 = a3 > a4 + val x1 = a3 < a4 + val x2 = a3 >= a4 + val x3 = a3 <= a4 +} + +// TESTCASE NUMBER: 4 +class Case4(val a: Int) { + var isCompared = false + operator fun compareTo(other: Case4):Int? = run{ + TODO() + } +} + +fun case4() { + val a3 = Case4(-1) + val a4 = Case4(-3) + + val x0 = a3 > a4 + val x1 = a3 < a4 + val x2 = a3 >= a4 + val x3 = a3 <= a4 +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt new file mode 100644 index 00000000000..a60d71c2793 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt @@ -0,0 +1,61 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-218 + * PLACE: expressions, comparison-expressions -> paragraph 5 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: All comparison expressions always have type kotlin.Boolean. + * HELPERS: checkType + */ + +class A(val a: Int) { + var isCompared = false + operator fun compareTo(other: A): Int = run { + isCompared = true + this.a - other.a + } +} + +// TESTCASE NUMBER: 1 +fun case1() { + val a1 = A(-1) + val a2 = A(-3) + + val x = a1 < a2 + + x checkType { check() } +} + +// TESTCASE NUMBER: 2 +fun case2() { + val a1 = A(-1) + val a2 = A(-3) + + val x = a1 > a2 + + x checkType { check() } +} + +// TESTCASE NUMBER: 3 +fun case3() { + val a1 = A(-1) + val a2 = A(-3) + + val x = a1 <= a2 + + x checkType { check() } +} + +// TESTCASE NUMBER: 4 +fun case4() { + val a1 = A(-1) + val a2 = A(-3) + + val x = a1 >= a2 + + x checkType { check() } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/testsMap.json new file mode 100644 index 00000000000..74e3105d67b --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/testsMap.json @@ -0,0 +1,26 @@ +{ + "4": { + "neg": { + "1": [ + { + "specVersion": "0.1-218", + "casesNumber": 4, + "description": "The compareTo operator function must have return type kotlin.Int", + "unexpectedBehaviour": false + } + ] + } + }, + "5": { + "pos": { + "1": [ + { + "specVersion": "0.1-218", + "casesNumber": 4, + "description": "All comparison expressions always have type kotlin.Boolean.", + "unexpectedBehaviour": false + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java index 617eee5b5f7..aa34d93979c 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java @@ -556,6 +556,81 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Comparison_expressions extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInComparison_expressions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_4 extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_4() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("1.1.kt") + public void test1_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg/1.1.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), true); + } + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_5 extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_5() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("1.1.kt") + public void test1_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt"); + } + + public void testAllFilesPresentInPos() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), true); + } + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java index 68fb9c8d049..14a8e3ff0d3 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java @@ -242,6 +242,83 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes } } + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Comparison_expressions extends AbstractBlackBoxCodegenTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInComparison_expressions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_1 extends AbstractBlackBoxCodegenTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_1() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractBlackBoxCodegenTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("2.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg/2.1.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), true); + } + } + + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractBlackBoxCodegenTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("2.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.1.kt"); + } + + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.2.kt"); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos/2.4.kt"); + } + + public void testAllFilesPresentInPos() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/comparison-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true); + } + } + } + } + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)