提交 c0b78cd6 编写于 作者: E Evgeny Gerashchenko

Added tests for SpecifyTypeExplicitlyAction.

上级 6d1bfce9
// "Specify Type Explicitly" "false"
val x = "<caret>"
\ No newline at end of file
// "Specify Type Explicitly" "true"
import java.util.Map
fun getEntry() : java.util.Map.Entry<jet.Array<String>, java.sql.Array> {
}
val x : Map.Entry<Array<String>, java.sql.Array> = getEntry()
\ No newline at end of file
// "Specify Type Explicitly" "true"
val x : (Int) -> String = { (a: Int) -> ""}
\ No newline at end of file
// "Specify Type Explicitly" "true"
class String {}
val x : jet.String = ""
\ No newline at end of file
// "Remove Explicitly Specified Type" "true"
val x = ""
\ No newline at end of file
// "Specify Type Explicitly" "true"
val x : Unit = #()
\ No newline at end of file
// "Specify Type Explicitly" "false"
val <caret>x = BadType()
\ No newline at end of file
// "Specify Type Explicitly" "false"
val x = "<caret>"
\ No newline at end of file
// "Specify Type Explicitly" "true"
fun getEntry() : java.util.Map.Entry<jet.Array<String>, java.sql.Array> {
}
val <caret>x = getEntry()
\ No newline at end of file
// "Specify Type Explicitly" "true"
val x<caret> = { (a: Int) -> ""}
\ No newline at end of file
// "Specify Type Explicitly" "true"
class String {}
val <caret>x = ""
\ No newline at end of file
// "Remove Explicitly Specified Type" "true"
val x<caret> : String = ""
\ No newline at end of file
// "Specify Type Explicitly" "true"
val x <caret>= #()
\ No newline at end of file
// "Specify Type Explicitly" "false"
val <caret>x = BadType()
\ No newline at end of file
/*
* Copyright 2010-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 org.jetbrains.jet.plugin.intentions;
import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
import com.intellij.openapi.projectRoots.Sdk;
import org.jetbrains.jet.plugin.PluginTestCaseBase;
public class SpecifyTypeExplicitlyTest extends LightIntentionActionTestCase {
public void testBadCaretPosition() {
doTest();
}
public void testClassNameClashing() {
doTest();
}
public void testFunctionType() {
doTest();
}
public void testStringRedefined() {
doTest();
}
public void testTypeAlreadyProvided() {
doTest();
}
public void testUnitType() {
doTest();
}
public void testUnknownType() {
doTest();
}
@Override
protected String getTestDataPath() {
return PluginTestCaseBase.getTestDataPathBase() + "/intentions/";
}
@Override
protected Sdk getProjectJDK() {
return PluginTestCaseBase.jdkFromIdeaHome();
}
@Override
protected String getBasePath() {
return "specifyType";
}
private void doTest() {
doSingleTest(getTestName(false) + ".kt");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册