From 12217ef2abca39d3c4de4359ed0b85b344a97a5d Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Tue, 19 May 2020 16:08:08 +0700 Subject: [PATCH] Add regression test for ReplaceWith #KT-35015 Fixed --- .../quickfix/deprecatedSymbolUsage/kt35015.kt | 12 ++++++++++++ .../quickfix/deprecatedSymbolUsage/kt35015.kt.after | 12 ++++++++++++ .../kotlin/idea/quickfix/QuickFixTestGenerated.java | 5 +++++ 3 files changed, 29 insertions(+) create mode 100644 idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt create mode 100644 idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt.after diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt b/idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt new file mode 100644 index 00000000000..f142c23397e --- /dev/null +++ b/idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt @@ -0,0 +1,12 @@ +// "Replace with 'kotlin.math.cos(x)'" "true" + +package package1 + +import package1.Math.cos + +object Math { + @Deprecated("Replace", ReplaceWith("kotlin.math.cos(x)", "kotlin.math.cos")) + fun cos(x: Double): Double = kotlin.math.cos(x) +} + +val test = cos(kotlin.math.PI) \ No newline at end of file diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt.after new file mode 100644 index 00000000000..3ed8b947e29 --- /dev/null +++ b/idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt.after @@ -0,0 +1,12 @@ +// "Replace with 'kotlin.math.cos(x)'" "true" + +package package1 + +import package1.Math.cos + +object Math { + @Deprecated("Replace", ReplaceWith("kotlin.math.cos(x)", "kotlin.math.cos")) + fun cos(x: Double): Double = kotlin.math.cos(x) +} + +val test = kotlin.math.cos(kotlin.math.PI) \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index f1cd35623c1..51195cfbc07 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -6185,6 +6185,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt"); } + @TestMetadata("kt35015.kt") + public void testKt35015() throws Exception { + runTest("idea/testData/quickfix/deprecatedSymbolUsage/kt35015.kt"); + } + @TestMetadata("localFun.kt") public void testLocalFun() throws Exception { runTest("idea/testData/quickfix/deprecatedSymbolUsage/localFun.kt");