From 1672fd69c6129e2e80c04d37062e0c2d8a6b5db0 Mon Sep 17 00:00:00 2001 From: Roman Efremov Date: Wed, 17 May 2023 10:55:34 +0200 Subject: [PATCH] [inspection] Fix tests in ReplaceWithUntil inspection Tests start failing after KTIJ-25447, because rangeUntil has more priority than until and now opt-in is not needed for rangeUntil. GitOrigin-RevId: 29b6138dc5f5ca0296aa90b8ccba8dcecab207d8 --- .../inspectionsLocal/replaceRangeToWithUntil/operator.kt | 1 + .../inspectionsLocal/replaceRangeToWithUntil/operator.kt.after | 1 + .../inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt | 1 + .../replaceRangeToWithUntil/operatorLong.kt.after | 1 + .../inspectionsLocal/replaceRangeToWithUntil/parentheses.kt | 1 + .../replaceRangeToWithUntil/parentheses.kt.after | 1 + .../testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt | 1 + .../inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt.after | 1 + 8 files changed, 8 insertions(+) diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt index 5da9500b712f..19a4b079065f 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun foo(a: Int) { for (i in 0..a - 1) { diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt.after index a9fb25b667ff..b2fcc3c40fef 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt.after @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun foo(a: Int) { for (i in 0 until a) { diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt index 3c25fc3237eb..cb2435d142f2 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun foo(a: Long) { for (i in 1L..a - 1L) { diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt.after index 47dfd709ffc0..720f700d2289 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt.after @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun foo(a: Long) { for (i in 1L until a) { diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt index ee62fcc142cc..22ab354f1ae9 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun example() { val max = 5 diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt.after index b1ae6146752b..2f64c17acd31 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/parentheses.kt.after @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun example() { val max = 5 diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt index f8a6e647d322..2764379d3e0a 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun foo(a: Int) { for (i in 0.rangeTo(a - 1)) { diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt.after index a9fb25b667ff..b2fcc3c40fef 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt.after @@ -1,4 +1,5 @@ // WITH_STDLIB +// COMPILER_ARGUMENTS: -XXLanguage:-RangeUntilOperator fun foo(a: Int) { for (i in 0 until a) {