Refactoring tests: Extracted SafeCallTest

This commit is contained in:
pTalanov
2012-03-02 13:12:23 +04:00
parent f9063ee137
commit 9c7cf6c69e
7 changed files with 47 additions and 22 deletions
@@ -99,7 +99,7 @@ public class FunctionTest extends AbstractExpressionTest {
try {
checkOutput("KT-921.kt", "");
} catch (Throwable e) {
System.out.println(e);
fail();
}
}
@@ -53,18 +53,6 @@ public final class PropertyAccessTest extends TranslationTest {
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 {
checkFooBoxIsTrue("namespacePropertyInitializer.kt");
}
@@ -83,15 +71,6 @@ public final class PropertyAccessTest extends TranslationTest {
checkFooBoxIsTrue("classUsesNamespaceProperties.kt");
}
public void testSafeAccess() throws Exception {
checkFooBoxIsTrue("safeAccess.kt");
}
public void testSafeExtensionFunctionCall() throws Exception {
checkFooBoxIsOk("safeExtensionFunctionCall.kt");
}
public void testExtensionLiteralSafeCall() throws Exception {
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");
}
}