push condition inside call action (IDEA-88814)

This commit is contained in:
anna
2012-07-17 12:09:21 +02:00
parent f21c22fd94
commit 6aaad412f0
10 changed files with 191 additions and 0 deletions
@@ -0,0 +1,7 @@
// "Push condition b inside method call" "true"
class Foo {
void bar(boolean b){
String s = foo(b ? "true" : "false");
}
String foo(String p) {return p;}
}
@@ -0,0 +1,7 @@
// "Push condition b inside method call" "true"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true") : foo("false");
}
String foo(String p) {return p;}
}
@@ -0,0 +1,8 @@
// "Push condition b inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true") : foo(false);
}
String foo(String p) {return p;}
String foo(boolean b) {return "false";}
}
@@ -0,0 +1,7 @@
// "Push condition b inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true", true) : foo("false", false);
}
String foo(String p, boolean b) {return p;}
}
@@ -0,0 +1,25 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInsight.daemon.quickFix;
public class PushConditionInCallTest extends LightQuickFixTestCase{
public void test() throws Exception { doAllTests(); }
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/pushConditionInCall";
}
}