From f37b7224da17e1965b1b00ff624a21069a7bbe2c Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Wed, 7 Dec 2016 17:29:03 +0300 Subject: [PATCH] Fix test: do not propose to change 'mod' to '%' --- .../replaceCallWithBinaryOperator/modSanityTest.kt | 4 +++- .../replaceCallWithBinaryOperator/modSanityTest.kt.after | 2 ++ .../replaceCallWithBinaryOperator/remSanityTest.kt | 9 +++++++++ .../replaceCallWithBinaryOperator/remSanityTest.kt.after | 9 +++++++++ .../kotlin/idea/intentions/IntentionTestGenerated.java | 6 ++++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt create mode 100644 idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt.after diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt index 6d057118a73..ce5206d04ef 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt @@ -1,4 +1,6 @@ -// INTENTION_TEXT: Replace with '%' operator +// INTENTION_TEXT: Replace call with binary operator +// IS_APPLICABLE: false + fun test() { class Test { operator fun mod(a: Int): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt.after b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt.after index a86efcf57fa..645715d4a78 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt.after +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/modSanityTest.kt.after @@ -1,4 +1,6 @@ // INTENTION_TEXT: Replace with '%' operator +// IS_APPLICABLE: false + fun test() { class Test { operator fun mod(a: Int): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt new file mode 100644 index 00000000000..87f2f294035 --- /dev/null +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt @@ -0,0 +1,9 @@ +// INTENTION_TEXT: Replace with '%' operator + +fun test() { + class Test { + operator fun rem(a: Int): Test = Test() + } + val test = Test() + test.rem(1) +} diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt.after b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt.after new file mode 100644 index 00000000000..f4644be3f76 --- /dev/null +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt.after @@ -0,0 +1,9 @@ +// INTENTION_TEXT: Replace with '%' operator + +fun test() { + class Test { + operator fun rem(a: Int): Test = Test() + } + val test = Test() + test % 1 +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index 1deba1e1b61..a4e8cee69ba 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -3054,6 +3054,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("remSanityTest.kt") + public void testRemSanityTest() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/remSanityTest.kt"); + doTest(fileName); + } + @TestMetadata("safeCompareTo.kt") public void testSafeCompareTo() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/safeCompareTo.kt");