Refactoring tests: Extracted SafeCallTest
This commit is contained in:
@@ -99,7 +99,7 @@ public class FunctionTest extends AbstractExpressionTest {
|
|||||||
try {
|
try {
|
||||||
checkOutput("KT-921.kt", "");
|
checkOutput("KT-921.kt", "");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
System.out.println(e);
|
fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,18 +53,6 @@ public final class PropertyAccessTest extends TranslationTest {
|
|||||||
checkFooBoxIsTrue("customSetter.kt");
|
checkFooBoxIsTrue("customSetter.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testSafeCall() throws Exception {
|
|
||||||
checkFooBoxIsTrue("safeCall.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: place safecalls under distinkt category
|
|
||||||
public void testSafeCallReturnsNullIfFails() throws Exception {
|
|
||||||
checkFooBoxIsTrue("safeCallReturnsNullIfFails.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void testNamespacePropertyInitializer() throws Exception {
|
public void testNamespacePropertyInitializer() throws Exception {
|
||||||
checkFooBoxIsTrue("namespacePropertyInitializer.kt");
|
checkFooBoxIsTrue("namespacePropertyInitializer.kt");
|
||||||
}
|
}
|
||||||
@@ -83,15 +71,6 @@ public final class PropertyAccessTest extends TranslationTest {
|
|||||||
checkFooBoxIsTrue("classUsesNamespaceProperties.kt");
|
checkFooBoxIsTrue("classUsesNamespaceProperties.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testSafeAccess() throws Exception {
|
|
||||||
checkFooBoxIsTrue("safeAccess.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSafeExtensionFunctionCall() throws Exception {
|
|
||||||
checkFooBoxIsOk("safeExtensionFunctionCall.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testExtensionLiteralSafeCall() throws Exception {
|
public void testExtensionLiteralSafeCall() throws Exception {
|
||||||
checkFooBoxIsTrue("extensionLiteralSafeCall.kt");
|
checkFooBoxIsTrue("extensionLiteralSafeCall.kt");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* 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 org.jetbrains.k2js.test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Pavel Talanov
|
||||||
|
*/
|
||||||
|
public final class SafeCallTest extends TranslationTest {
|
||||||
|
|
||||||
|
final private static String MAIN = "safeCall/";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String mainDirectory() {
|
||||||
|
return MAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testSafeAccess() throws Exception {
|
||||||
|
checkFooBoxIsTrue("safeAccess.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testSafeExtensionFunctionCall() throws Exception {
|
||||||
|
checkFooBoxIsOk("safeExtensionFunctionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testSafeCall() throws Exception {
|
||||||
|
checkFooBoxIsTrue("safeCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testSafeCallReturnsNullIfFails() throws Exception {
|
||||||
|
checkFooBoxIsTrue("safeCallReturnsNullIfFails.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user