Cosmetics after pulling https://github.com/JetBrains/kotlin/pull/67
This commit is contained in:
@@ -26,7 +26,6 @@ import org.jetbrains.k2js.test.rhino.RhinoResultChecker;
|
||||
import org.jetbrains.k2js.test.utils.TranslationUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -89,8 +88,8 @@ public abstract class BasicTest extends TestWithEnvironment {
|
||||
assert success;
|
||||
}
|
||||
|
||||
protected List<String> additionalJSFiles(EcmaVersion ecmaVersion) {
|
||||
List<String> list = new ArrayList<String>(2);
|
||||
protected List<String> additionalJSFiles(@NotNull EcmaVersion ecmaVersion) {
|
||||
List<String> list = Lists.newArrayList();
|
||||
list.add(ecmaVersion == EcmaVersion.v5 ? KOTLIN_JS_LIB_ECMA_5 : KOTLIN_JS_LIB_ECMA_3);
|
||||
list.add(KOTLIN_JS_LIB);
|
||||
return list;
|
||||
|
||||
@@ -78,7 +78,7 @@ public abstract class SingleFileTranslationTest extends BasicTest {
|
||||
|
||||
protected void checkOutput(@NotNull String kotlinFilename,
|
||||
@NotNull String expectedResult,
|
||||
@NotNull EnumSet<EcmaVersion> ecmaVersions,
|
||||
@NotNull Iterable<EcmaVersion> ecmaVersions,
|
||||
String... args) throws Exception {
|
||||
generateJavaScriptFiles(kotlinFilename, MainCallParameters.mainWithArguments(Lists.newArrayList(args)), ecmaVersions);
|
||||
runRhinoTests(kotlinFilename, ecmaVersions, new RhinoSystemOutputChecker(expectedResult));
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.jetbrains.k2js.test.semantics;
|
||||
|
||||
import junit.framework.Test;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.k2js.config.EcmaVersion;
|
||||
import org.jetbrains.k2js.test.BasicTest;
|
||||
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
||||
import org.jetbrains.k2js.translate.context.Namer;
|
||||
@@ -37,7 +36,7 @@ public final class ExamplesTest extends SingleFileTranslationTest {
|
||||
|
||||
@Override
|
||||
public void runTest() throws Exception {
|
||||
runFunctionOutputTest(EcmaVersion.all(), filename, Namer.getRootNamespaceName(), "box", "OK");
|
||||
runFunctionOutputTest(filename, Namer.getRootNamespaceName(), "box", "OK");
|
||||
}
|
||||
|
||||
public static Test suite() throws Exception {
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class NativeInteropTest extends SingleFileTranslationTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> additionalJSFiles(EcmaVersion ecmaVersion) {
|
||||
protected List<String> additionalJSFiles(@NotNull EcmaVersion ecmaVersion) {
|
||||
List<String> result = Lists.newArrayList(super.additionalJSFiles(ecmaVersion));
|
||||
result.addAll(JsTestUtils.getAllFilesInDir(pathToTestFiles() + NATIVE));
|
||||
return result;
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -36,22 +35,7 @@ public final class JsTestUtils {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static EnumSet<EcmaVersion> failsOn(EcmaVersion... versions) {
|
||||
EnumSet<EcmaVersion> result = EcmaVersion.all();
|
||||
for (EcmaVersion version : versions) {
|
||||
boolean success = result.remove(version);
|
||||
assert success;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static EnumSet<EcmaVersion> failsOnEcmaV5() {
|
||||
return failsOn(EcmaVersion.v5);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String convertFileNameToDotJsFile(@NotNull String filename, EcmaVersion ecmaVersion) {
|
||||
public static String convertFileNameToDotJsFile(@NotNull String filename, @NotNull EcmaVersion ecmaVersion) {
|
||||
String postFix = "_" + ecmaVersion.toString() + ".js";
|
||||
int index = filename.lastIndexOf('.');
|
||||
if (index < 0) {
|
||||
|
||||
Reference in New Issue
Block a user