JS tests: added tests for dynamic.

This commit is contained in:
Zalim Bashorov
2014-12-09 23:07:25 +03:00
parent 7d9b824411
commit af82e69214
25 changed files with 723 additions and 0 deletions
@@ -0,0 +1,21 @@
/*
* Copyright 2010-2014 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.semantics
import org.jetbrains.k2js.test.SingleFileTranslationTest
public abstract class AbstractDynamicTest : SingleFileTranslationTest("dynamic/")
@@ -0,0 +1,146 @@
/*
* Copyright 2010-2014 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.semantics;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.jet.JUnit3RunnerWithInners;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.junit.runner.RunWith;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("js/js.translator/testData/dynamic/cases")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class DynamicTestGenerated extends AbstractDynamicTest {
public void testAllFilesPresentInCases() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/dynamic/cases"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("binaryOperations.kt")
public void testBinaryOperations() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/binaryOperations.kt");
doTest(fileName);
}
@TestMetadata("callGetMethod.kt")
public void testCallGetMethod() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/callGetMethod.kt");
doTest(fileName);
}
@TestMetadata("callMethods.kt")
public void testCallMethods() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/callMethods.kt");
doTest(fileName);
}
@TestMetadata("callSetMethod.kt")
public void testCallSetMethod() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/callSetMethod.kt");
doTest(fileName);
}
@TestMetadata("compareTo.kt")
public void testCompareTo() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/compareTo.kt");
doTest(fileName);
}
@TestMetadata("equals.kt")
public void testEquals() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/equals.kt");
doTest(fileName);
}
@TestMetadata("getByBrackets.kt")
public void testGetByBrackets() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/getByBrackets.kt");
doTest(fileName);
}
@TestMetadata("identityEquals.kt")
public void testIdentityEquals() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/identityEquals.kt");
doTest(fileName);
}
@TestMetadata("in.kt")
public void testIn() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/in.kt");
doTest(fileName);
}
@TestMetadata("incrementAndDecrement.kt")
public void testIncrementAndDecrement() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/incrementAndDecrement.kt");
doTest(fileName);
}
@TestMetadata("infixCall.kt")
public void testInfixCall() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/infixCall.kt");
doTest(fileName);
}
@TestMetadata("invoke.kt")
public void testInvoke() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/invoke.kt");
doTest(fileName);
}
@TestMetadata("is.kt")
public void testIs() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/is.kt");
doTest(fileName);
}
@TestMetadata("isJsPrimitiveType.kt")
public void testIsJsPrimitiveType() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/isJsPrimitiveType.kt");
doTest(fileName);
}
@TestMetadata("operationsWithAssignment.kt")
public void testOperationsWithAssignment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/operationsWithAssignment.kt");
doTest(fileName);
}
@TestMetadata("propertyAccess.kt")
public void testPropertyAccess() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/propertyAccess.kt");
doTest(fileName);
}
@TestMetadata("setByBrackets.kt")
public void testSetByBrackets() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/setByBrackets.kt");
doTest(fileName);
}
@TestMetadata("unaryOperations.kt")
public void testUnaryOperations() throws Exception {
String fileName = JetTestUtils.navigationMetadata("js/js.translator/testData/dynamic/cases/unaryOperations.kt");
doTest(fileName);
}
}