modified outdated tests, removed changes by Natasha
This commit is contained in:
@@ -1 +0,0 @@
|
||||
C:\Dev\Projects\jet-contrib\k2js\jslib\src
|
||||
@@ -23,7 +23,7 @@ public open class Iterator<T>() {
|
||||
|
||||
library
|
||||
val Collections = object {
|
||||
library("max")
|
||||
library("collectionsMax")
|
||||
public fun max<T>(col : Collection<T>, comp : Comparator<T>) : T = f
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class Config {
|
||||
List<String> lines = Files.readLines(file, Charsets.UTF_8);
|
||||
return lines.get(0);
|
||||
} catch (Exception ex) {
|
||||
return "/src";
|
||||
return "jslib\\src";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.jetbrains.k2js.utils;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -13,10 +12,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.plugin.JetLanguage;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,20 +29,7 @@ public final class JetFileUtils {
|
||||
|
||||
@NotNull
|
||||
private static String doLoadFile(@NotNull String path) throws IOException {
|
||||
path = path.replace("\\", "/");
|
||||
InputStreamReader reader = new InputStreamReader(JetFileUtils.class.getResourceAsStream(path));
|
||||
StringBuilder response = new StringBuilder();
|
||||
BufferedReader bufferedReader = new BufferedReader(reader);
|
||||
|
||||
String tmp;
|
||||
while ((tmp = bufferedReader.readLine()) != null) {
|
||||
response.append(tmp);
|
||||
response.append(System.getProperty("line.separator"));
|
||||
}
|
||||
|
||||
reader.close();
|
||||
String text = response.toString();
|
||||
// String text = FileUtil.loadFile(new File(path), CharsetToolkit.UTF8).trim();
|
||||
String text = FileUtil.loadFile(new File(path), CharsetToolkit.UTF8).trim();
|
||||
text = StringUtil.convertLineSeparators(text);
|
||||
return text;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class OperatorOverloadingTest extends TranslationTest {
|
||||
}
|
||||
|
||||
|
||||
public void testPrefixInc() throws Exception {
|
||||
public void testPrefixDecOverload() throws Exception {
|
||||
testFooBoxIsTrue("prefixDecOverload.kt");
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,8 @@ class ArrayWrapper<T>() {
|
||||
contents.add(item)
|
||||
}
|
||||
|
||||
fun plusAssign(rhs: ArrayWrapper<T>): ArrayWrapper<T> {
|
||||
val result = ArrayWrapper<T>()
|
||||
result.contents.addAll(contents)
|
||||
result.contents.addAll(rhs.contents)
|
||||
return result
|
||||
fun plusAssign(rhs: ArrayWrapper<T>) {
|
||||
contents.addAll(rhs.contents)
|
||||
}
|
||||
|
||||
fun get(index: Int): T {
|
||||
@@ -26,5 +23,5 @@ fun box(): String {
|
||||
val v3 = v1
|
||||
v2.add("bar")
|
||||
v1 += v2
|
||||
return if (v1.contents.size() == 2 && v3.contents.size() == 1) "OK" else "fail"
|
||||
return if (v1.contents.size() == 2 && v3.contents.size() == 2) "OK" else "fail"
|
||||
}
|
||||
|
||||
@@ -5,11 +5,17 @@ var a = MyInt()
|
||||
class MyInt() {
|
||||
var b = 0
|
||||
|
||||
fun inc() = b + 1
|
||||
fun inc() : MyInt {
|
||||
val res = MyInt();
|
||||
res.b = b;
|
||||
res.b++;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun box() : Boolean {
|
||||
a++;
|
||||
return (a.b == 1);
|
||||
a++;
|
||||
return (a.b == 2);
|
||||
}
|
||||
@@ -3,8 +3,10 @@ package foo
|
||||
class MyInt() {
|
||||
var b = 0
|
||||
|
||||
fun inc() {
|
||||
b = b + 1;
|
||||
fun inc() : MyInt {
|
||||
val res = MyInt()
|
||||
res.b++;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ package foo
|
||||
class MyInt() {
|
||||
var b = 0
|
||||
|
||||
fun dec() {
|
||||
b = b + 1;
|
||||
fun dec() : MyInt {
|
||||
val res = MyInt()
|
||||
res.b++;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user