diff --git a/js/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java b/js/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java index abd2968eebb..638cbddf400 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java @@ -99,7 +99,7 @@ public class FunctionTest extends AbstractExpressionTest { try { checkOutput("KT-921.kt", ""); } catch (Throwable e) { - System.out.println(e); + fail(); } } diff --git a/js/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java b/js/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java index 78d7e0243dc..9d15dbf0f2c 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java @@ -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"); } diff --git a/js/js.tests/test/org/jetbrains/k2js/test/SafeCallTest.java b/js/js.tests/test/org/jetbrains/k2js/test/SafeCallTest.java new file mode 100644 index 00000000000..56180ddcddc --- /dev/null +++ b/js/js.tests/test/org/jetbrains/k2js/test/SafeCallTest.java @@ -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"); + } +} diff --git a/js/js.translator/testFiles/propertyAccess/cases/safeAccess.kt b/js/js.translator/testFiles/safeCall/cases/safeAccess.kt similarity index 100% rename from js/js.translator/testFiles/propertyAccess/cases/safeAccess.kt rename to js/js.translator/testFiles/safeCall/cases/safeAccess.kt diff --git a/js/js.translator/testFiles/propertyAccess/cases/safeCall.kt b/js/js.translator/testFiles/safeCall/cases/safeCall.kt similarity index 100% rename from js/js.translator/testFiles/propertyAccess/cases/safeCall.kt rename to js/js.translator/testFiles/safeCall/cases/safeCall.kt diff --git a/js/js.translator/testFiles/propertyAccess/cases/safeCallReturnsNullIfFails.kt b/js/js.translator/testFiles/safeCall/cases/safeCallReturnsNullIfFails.kt similarity index 100% rename from js/js.translator/testFiles/propertyAccess/cases/safeCallReturnsNullIfFails.kt rename to js/js.translator/testFiles/safeCall/cases/safeCallReturnsNullIfFails.kt diff --git a/js/js.translator/testFiles/propertyAccess/cases/safeExtensionFunctionCall.kt b/js/js.translator/testFiles/safeCall/cases/safeExtensionFunctionCall.kt similarity index 100% rename from js/js.translator/testFiles/propertyAccess/cases/safeExtensionFunctionCall.kt rename to js/js.translator/testFiles/safeCall/cases/safeExtensionFunctionCall.kt