Converter tests:
Use generated tests approach in converter tests Introduce two seperate generated test cases of each of configurations, all tests are generated in both test cases Test data for plugin configuration has extension "ide.kt", for basic configuration "*.kt" Test data file is used to determine type of the test (file/class/expression/...) instead of directory, all test data is moved accordingly Add abstract base classes for generated tests Rename test folder "file" to "misc" (for the lack of imagination)
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
<orderEntry type="module" module-name="jps-plugin" scope="TEST" />
|
<orderEntry type="module" module-name="jps-plugin" scope="TEST" />
|
||||||
<orderEntry type="module" module-name="util" scope="TEST" />
|
<orderEntry type="module" module-name="util" scope="TEST" />
|
||||||
<orderEntry type="library" scope="TEST" name="kotlin-runtime" level="project" />
|
<orderEntry type="library" scope="TEST" name="kotlin-runtime" level="project" />
|
||||||
|
<orderEntry type="module" module-name="j2k-tests" scope="TEST" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ import org.jetbrains.jet.resolve.calls.AbstractResolvedCallsTest
|
|||||||
import org.jetbrains.jet.plugin.refactoring.rename.AbstractRenameTest
|
import org.jetbrains.jet.plugin.refactoring.rename.AbstractRenameTest
|
||||||
import org.jetbrains.jet.generators.tests.generator.SingleClassTestModel
|
import org.jetbrains.jet.generators.tests.generator.SingleClassTestModel
|
||||||
import org.jetbrains.jet.generators.tests.generator.TestClassModel
|
import org.jetbrains.jet.generators.tests.generator.TestClassModel
|
||||||
|
import org.jetbrains.jet.j2k.test.AbstractJavaToKotlinConverterPluginTest
|
||||||
|
import org.jetbrains.jet.j2k.test.AbstractJavaToKotlinConverterBasicTest
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
System.setProperty("java.awt.headless", "true")
|
System.setProperty("java.awt.headless", "true")
|
||||||
@@ -413,6 +415,16 @@ fun main(args: Array<String>) {
|
|||||||
model("dataFlowValueRendering")
|
model("dataFlowValueRendering")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testGroup("j2k/tests/test", "j2k/tests/testData") {
|
||||||
|
testClass(javaClass<AbstractJavaToKotlinConverterPluginTest>()) {
|
||||||
|
model("ast", extension = "jav")
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass(javaClass<AbstractJavaToKotlinConverterBasicTest>()) {
|
||||||
|
model("ast", extension = "jav")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestGroup(val testsRoot: String, val testDataRoot: String) {
|
private class TestGroup(val testsRoot: String, val testDataRoot: String) {
|
||||||
|
|||||||
+22
-84
@@ -21,27 +21,28 @@ import com.intellij.openapi.util.io.FileUtil
|
|||||||
import junit.framework.Assert
|
import junit.framework.Assert
|
||||||
import com.intellij.psi.PsiJavaFile
|
import com.intellij.psi.PsiJavaFile
|
||||||
import com.intellij.psi.PsiFile
|
import com.intellij.psi.PsiFile
|
||||||
import junit.framework.Test
|
|
||||||
import junit.framework.TestSuite
|
|
||||||
import java.io.FilenameFilter
|
|
||||||
import java.io.FileFilter
|
|
||||||
import java.util.Collections
|
|
||||||
import org.jetbrains.jet.j2k.Converter
|
import org.jetbrains.jet.j2k.Converter
|
||||||
import org.jetbrains.jet.j2k.JavaToKotlinTranslator
|
import org.jetbrains.jet.j2k.JavaToKotlinTranslator
|
||||||
import org.jetbrains.jet.ConfigurationKind
|
import org.jetbrains.jet.ConfigurationKind
|
||||||
import org.jetbrains.jet.JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations
|
import org.jetbrains.jet.JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations
|
||||||
import com.intellij.testFramework.UsefulTestCase
|
import com.intellij.testFramework.UsefulTestCase
|
||||||
import org.jetbrains.jet.j2k.ConverterSettings
|
import org.jetbrains.jet.j2k.ConverterSettings
|
||||||
|
import org.jetbrains.jet.j2k.PluginSettings
|
||||||
|
import org.jetbrains.jet.j2k.TestSettings
|
||||||
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
public abstract class StandaloneJavaToKotlinConverterTest(val dataPath: String,
|
public abstract class AbstractJavaToKotlinConverterPluginTest() : AbstractJavaToKotlinConverterTest("ide.kt", PluginSettings)
|
||||||
val name: String,
|
public abstract class AbstractJavaToKotlinConverterBasicTest() : AbstractJavaToKotlinConverterTest("kt", TestSettings)
|
||||||
val settings: ConverterSettings) : UsefulTestCase() {
|
|
||||||
|
|
||||||
protected override fun runTest(): Unit {
|
public abstract class AbstractJavaToKotlinConverterTest(val kotlinFileExtension: String,
|
||||||
|
val settings: ConverterSettings) : UsefulTestCase() {
|
||||||
|
|
||||||
|
val testHeaderPattern = Pattern.compile("//(expression|statement|method|class|file|comp)\n")
|
||||||
|
|
||||||
|
protected fun doTest(javaPath: String) {
|
||||||
val jetCoreEnvironment = createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable(), ConfigurationKind.JDK_ONLY)
|
val jetCoreEnvironment = createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable(), ConfigurationKind.JDK_ONLY)
|
||||||
val converter = Converter(jetCoreEnvironment.getProject(), settings)
|
val converter = Converter(jetCoreEnvironment.getProject(), settings)
|
||||||
val javaPath = "j2k/tests/testData/" + getTestFilePath()
|
val kotlinPath = javaPath.replace(".jav", ".$kotlinFileExtension")
|
||||||
val kotlinPath = javaPath.replace(".jav", ".kt")
|
|
||||||
val kotlinFile = File(kotlinPath)
|
val kotlinFile = File(kotlinPath)
|
||||||
if (!kotlinFile.exists()) {
|
if (!kotlinFile.exists()) {
|
||||||
FileUtil.writeToFile(kotlinFile, "")
|
FileUtil.writeToFile(kotlinFile, "")
|
||||||
@@ -49,18 +50,20 @@ public abstract class StandaloneJavaToKotlinConverterTest(val dataPath: String,
|
|||||||
|
|
||||||
val expected = FileUtil.loadFile(kotlinFile, true)
|
val expected = FileUtil.loadFile(kotlinFile, true)
|
||||||
val javaFile = File(javaPath)
|
val javaFile = File(javaPath)
|
||||||
val javaCode = FileUtil.loadFile(javaFile, true)
|
val fileContents = FileUtil.loadFile(javaFile, true)
|
||||||
val parentFileName = javaFile.getParentFile()?.getName()
|
val matcher = testHeaderPattern.matcher(fileContents)
|
||||||
|
matcher.find()
|
||||||
val actual = when (parentFileName) {
|
val prefix = matcher.group().trim().substring(2)
|
||||||
|
val javaCode = matcher.replaceFirst("")
|
||||||
|
val actual = when (prefix) {
|
||||||
"expression" -> expressionToKotlin(converter, javaCode)
|
"expression" -> expressionToKotlin(converter, javaCode)
|
||||||
"statement" -> statementToKotlin(converter, javaCode)
|
"statement" -> statementToKotlin(converter, javaCode)
|
||||||
"method" -> methodToKotlin(converter, javaCode)
|
"method" -> methodToKotlin(converter, javaCode)
|
||||||
"class" -> fileToKotlin(converter, javaCode)
|
"class" -> fileToKotlin(converter, javaCode)
|
||||||
"file" -> fileToKotlin(converter, javaCode)
|
"file" -> fileToKotlin(converter, javaCode)
|
||||||
"comp" -> fileToFileWithCompatibilityImport(javaCode)
|
"comp" -> fileToFileWithCompatibilityImport(javaCode)
|
||||||
else -> throw IllegalStateException("Specify what is it: file, class, method, statement or expression:" +
|
else -> throw IllegalStateException("Specify what is it: file, class, method, statement or expression "+
|
||||||
"$javaPath parent: $parentFileName")
|
"using the first line of test data file")
|
||||||
}
|
}
|
||||||
|
|
||||||
val tmp = File(kotlinPath + ".tmp")
|
val tmp = File(kotlinPath + ".tmp")
|
||||||
@@ -75,10 +78,6 @@ public abstract class StandaloneJavaToKotlinConverterTest(val dataPath: String,
|
|||||||
Assert.assertEquals(expected, actual)
|
Assert.assertEquals(expected, actual)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTestFilePath(): String {
|
|
||||||
return "$dataPath/$name.jav"
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun fileToKotlin(converter: Converter, text: String): String {
|
private fun fileToKotlin(converter: Converter, text: String): String {
|
||||||
return generateKotlinCode(converter, JavaToKotlinTranslator.createFile(converter.project, text))
|
return generateKotlinCode(converter, JavaToKotlinTranslator.createFile(converter.project, text))
|
||||||
}
|
}
|
||||||
@@ -98,7 +97,7 @@ public abstract class StandaloneJavaToKotlinConverterTest(val dataPath: String,
|
|||||||
|
|
||||||
private fun expressionToKotlin(converter: Converter, code: String?): String {
|
private fun expressionToKotlin(converter: Converter, code: String?): String {
|
||||||
var result = statementToKotlin(converter, "final Object o =" + code + "}")
|
var result = statementToKotlin(converter, "final Object o =" + code + "}")
|
||||||
result = result.replaceFirst("val o : Any\\? =", "").replaceFirst("val o : Any = ", "")
|
result = result.replaceFirst("val o : Any\\? =", "").replaceFirst("val o : Any = ", "").replaceFirst("val o = ", "")
|
||||||
return prettify(result)
|
return prettify(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,65 +121,4 @@ public abstract class StandaloneJavaToKotlinConverterTest(val dataPath: String,
|
|||||||
|
|
||||||
return code.trim().replaceAll("\r\n", "\n").replaceAll(" \n", "\n").replaceAll("\n ", "\n").replaceAll("\n+", "\n").replaceAll(" +", " ").trim()
|
return code.trim().replaceAll("\r\n", "\n").replaceAll(" \n", "\n").replaceAll("\n ", "\n").replaceAll("\n+", "\n").replaceAll(" +", " ").trim()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
private val emptyFilter = object : FilenameFilter {
|
|
||||||
public override fun accept(dir: File, name: String): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public trait NamedTestFactory {
|
|
||||||
fun createTest(dataPath: String, name: String): Test
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun suiteForDirectory(baseDataDir: String?, dataPath: String, factory: NamedTestFactory): TestSuite {
|
|
||||||
return suiteForDirectory(baseDataDir, dataPath, true, emptyFilter, factory)
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun suiteForDirectory(baseDataDir: String?, dataPath: String, recursive: Boolean, filter: FilenameFilter, factory: NamedTestFactory): TestSuite {
|
|
||||||
val suite = TestSuite(dataPath)
|
|
||||||
val extensionJava = ".jav"
|
|
||||||
val extensionFilter = object : FilenameFilter {
|
|
||||||
public override fun accept(dir: File, name: String): Boolean {
|
|
||||||
return name.endsWith(extensionJava)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val resultFilter =
|
|
||||||
if (filter != emptyFilter) {
|
|
||||||
object : FilenameFilter {
|
|
||||||
public override fun accept(dir: File, name: String): Boolean {
|
|
||||||
return (extensionFilter.accept(dir, name)) && filter.accept(dir, name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
extensionFilter
|
|
||||||
}
|
|
||||||
|
|
||||||
val dir = File(baseDataDir + dataPath)
|
|
||||||
val dirFilter = object : FileFilter {
|
|
||||||
public override fun accept(pathname: File): Boolean {
|
|
||||||
return pathname.isDirectory()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recursive) {
|
|
||||||
val files = dir.listFiles(dirFilter)
|
|
||||||
val subdirs = files!!.toLinkedList()
|
|
||||||
Collections.sort(subdirs)
|
|
||||||
for (subdir in subdirs) {
|
|
||||||
suite.addTest(suiteForDirectory(baseDataDir, dataPath + "/" + subdir.getName(), recursive, filter, factory))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val files = (dir.listFiles(resultFilter))!!.toLinkedList()
|
|
||||||
Collections.sort(files)
|
|
||||||
for (file in files) {
|
|
||||||
val testName = file.getName().substring(0, (file.getName().length()) - (extensionJava.length()))
|
|
||||||
suite.addTest(factory.createTest(dataPath, testName))
|
|
||||||
}
|
|
||||||
return suite
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2013 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.jet.j2k.test;
|
|
||||||
|
|
||||||
import junit.framework.Test;
|
|
||||||
import junit.framework.TestSuite;
|
|
||||||
import org.jetbrains.jet.j2k.J2kPackage;
|
|
||||||
|
|
||||||
import static org.jetbrains.jet.j2k.test.TestPackage.suiteForDirectory;
|
|
||||||
|
|
||||||
public class BasicConverterTestSuite {
|
|
||||||
|
|
||||||
private BasicConverterTestSuite() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
TestSuite suite = new TestSuite();
|
|
||||||
suite.addTest(suiteForDirectory("j2k/tests/testData", "/ast", new NamedTestFactory() {
|
|
||||||
@Override
|
|
||||||
public Test createTest(String dataPath, String name) {
|
|
||||||
//noinspection JUnitTestCaseWithNoTests
|
|
||||||
return new StandaloneJavaToKotlinConverterTest(dataPath, name, J2kPackage.getTestSettings()) {
|
|
||||||
@Override
|
|
||||||
protected void runTest() {
|
|
||||||
super.runTest();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
return suite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2013 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.jet.j2k.test;
|
|
||||||
|
|
||||||
import junit.framework.Test;
|
|
||||||
import junit.framework.TestSuite;
|
|
||||||
import org.jetbrains.jet.j2k.J2kPackage;
|
|
||||||
|
|
||||||
import static org.jetbrains.jet.j2k.test.TestPackage.suiteForDirectory;
|
|
||||||
|
|
||||||
public class ConverterTestSuiteForPlugin {
|
|
||||||
private ConverterTestSuiteForPlugin() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
|
|
||||||
TestSuite suite = new TestSuite();
|
|
||||||
suite.addTest(suiteForDirectory("j2k/tests/testData", "/plugin", new NamedTestFactory() {
|
|
||||||
@Override
|
|
||||||
public Test createTest(String dataPath, String name) {
|
|
||||||
//noinspection JUnitTestCaseWithNoTests
|
|
||||||
return new StandaloneJavaToKotlinConverterTest(dataPath, name, J2kPackage.getPluginSettings()) {
|
|
||||||
@Override
|
|
||||||
protected void runTest() {
|
|
||||||
super.runTest();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
return suite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2327
File diff suppressed because it is too large
Load Diff
+2327
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
|||||||
|
package test
|
||||||
|
public open class Test(str : String) {
|
||||||
|
var myStr : String = "String2"
|
||||||
|
public open fun sout(str : String) : Unit {
|
||||||
|
System.out.println(str)
|
||||||
|
}
|
||||||
|
public open fun dummy(str : String) : String {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
public open fun test() : Unit {
|
||||||
|
sout("String")
|
||||||
|
val test = "String2"
|
||||||
|
sout(test)
|
||||||
|
sout(dummy(test))
|
||||||
|
Test(test)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
myStr = str
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
//file
|
||||||
package test;
|
package test;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package test
|
||||||
|
open class Foo() {
|
||||||
|
open fun execute() : Unit {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open class Bar() {
|
||||||
|
var fooNotNull : Foo = Foo()
|
||||||
|
var fooNullable : Foo = null
|
||||||
|
}
|
||||||
|
open class Test() {
|
||||||
|
public open fun test(barNotNull : Bar, barNullable : Bar) : Unit {
|
||||||
|
barNotNull.fooNotNull.execute()
|
||||||
|
barNotNull.fooNullable.execute()
|
||||||
|
barNullable.fooNotNull.execute()
|
||||||
|
barNullable.fooNullable.execute()
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
//file
|
||||||
package test;
|
package test;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
open class Test() {
|
||||||
|
var str : String = 0
|
||||||
|
{
|
||||||
|
str = "Ola"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
//file
|
||||||
class Test {
|
class Test {
|
||||||
String str;
|
String str;
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
open class Test() {
|
||||||
|
var str : String = 0
|
||||||
|
class object {
|
||||||
|
{
|
||||||
|
str = "Ola"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
//file
|
||||||
class Test {
|
class Test {
|
||||||
String str;
|
String str;
|
||||||
static {
|
static {
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
//expression
|
||||||
|
myArray[myLibrary.calculateIndex(100)]
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
//expression
|
||||||
|
myArray[10]
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
//expression
|
||||||
|
myArray[i]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = doubleArray(1.0, 2.0, 3.0)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
double[] a = new double[]{1.0, 2, 3}
|
double[] a = new double[]{1.0, 2, 3}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
val a = 0
|
||||||
|
val b = 0
|
||||||
|
val c = 0
|
||||||
|
val ds = doubleArray((a).toDouble(), (b).toDouble(), (c).toDouble())
|
||||||
+1
@@ -1,2 +1,3 @@
|
|||||||
|
//statement
|
||||||
double a = 0, b = 0, c = 0;
|
double a = 0, b = 0, c = 0;
|
||||||
double ds[] = {a, b, c};
|
double ds[] = {a, b, c};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = floatArray(1.0, 2.0, 3.0)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
float[] a = new float[]{1, 2, 3.0}
|
float[] a = new float[]{1, 2, 3.0}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = IntArray(10)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int[] a = new int[10]
|
int[] a = new int[10]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = array<java.lang.Double>(1.0, 2.0, 3.0)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
java.lang.Double[] a = new java.lang.Double[]{1, 2, 3};
|
java.lang.Double[] a = new java.lang.Double[]{1, 2, 3};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = array<java.lang.Float>(1.0, 2.0, 3.0)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
java.lang.Float[] a = new java.lang.Float[]{1, 2, 3};
|
java.lang.Float[] a = new java.lang.Float[]{1, 2, 3};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = byteArray(1, 2, 3)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
byte[] a = new byte[] {1, 2, 3};
|
byte[] a = new byte[] {1, 2, 3};
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//expression
|
||||||
new int[] {1, 2, 3};
|
new int[] {1, 2, 3};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
intArray(1, 2, 3)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = arrayOfNulls<Any>(10)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
Object[] a = new Object[10]
|
Object[] a = new Object[10]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = intArray(1, 2, 3)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int[] a = {1, 2, 3};
|
int[] a = {1, 2, 3};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
val a = 0
|
||||||
|
val b = 0
|
||||||
|
val c = 0
|
||||||
|
val `is` = intArray(a, b, c)
|
||||||
+1
@@ -1,2 +1,3 @@
|
|||||||
|
//statement
|
||||||
int a = 0, b = 0, c = 0;
|
int a = 0, b = 0, c = 0;
|
||||||
int is[] = {a, b, c};
|
int is[] = {a, b, c};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = array<IntArray>(intArray(1, 2, 3), intArray(4, 5, 6), intArray(7, 8, 9))
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int[][] a = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
|
int[][] a = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val d2 = array<IntArray>()
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int [][] d2 = new int[][]{};
|
int [][] d2 = new int[][]{};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val d2 = arrayOfNulls<IntArray>(5)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int [][] d2 = new int[5][];
|
int [][] d2 = new int[5][];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val d3 = Array<Array<IntArray>>(5, {arrayOfNulls<IntArray>(5)})
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int [][][] d3 = new int[5][5][];
|
int [][][] d3 = new int[5][5][];
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
val d2 = Array<IntArray>(5, {IntArray(5)})
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int [][] d2 = new int[5][5];
|
int [][] d2 = new int[5][5];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val ss = Array<Array<String>>(5, {arrayOfNulls<String>(5)})
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
String [][] ss = new String[5][5];
|
String [][] ss = new String[5][5];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val sss = Array<Array<Array<String>>>(5, {Array<Array<String>>(5, {arrayOfNulls<String>(5)})})
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
String [][][] sss = new String[5][5][5];
|
String [][][] sss = new String[5][5][5];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = longArray(1, 2, 3)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
long[] a = new long[]{1, 2, 3}
|
long[] a = new long[]{1, 2, 3}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fun fromArrayToCollection(a : Array<Foo>) : Unit {
|
||||||
|
}
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//method
|
||||||
void fromArrayToCollection(Foo[] a) {}
|
void fromArrayToCollection(Foo[] a) {}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = intArray(1, 2, 3)
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
int[] a = new int[]{1, 2, 3}
|
int[] a = new int[]{1, 2, 3}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
val a = array<String>("abc")
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
String[] a = new String[]{"abc"}
|
String[] a = new String[]{"abc"}
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
assert boolMethod();
|
assert boolMethod();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
assert {boolMethod()}
|
||||||
+1
@@ -1 +1,2 @@
|
|||||||
|
//statement
|
||||||
assert(boolMethod());
|
assert(boolMethod());
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
assert {(boolMethod())}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user