removed some string methods from library.jet

This commit is contained in:
svtk
2012-01-20 19:31:04 +04:00
parent f541cce098
commit b3eb44e769
8 changed files with 39 additions and 35 deletions
-10
View File
@@ -50,16 +50,6 @@ class String() : Comparable<String> {
fun plus(other : Any?) : String
fun equals(other : Any?) : Boolean
fun equalsIgnoreCase(other: String?) : Boolean
fun substring(start: Int): String
fun substring(start: Int, end: Int): String
fun startsWith(prefix: String, toffset: Int): Boolean
fun startsWith(prefix: String): Boolean
fun endsWith(suffix: String): Boolean
fun trim(): String
}
@@ -8,4 +8,6 @@ fun test(s: String?) {
val e: String = <!TYPE_MISMATCH!>s?.length<!> ?: "empty"
val <!UNUSED_VARIABLE!>f<!>: Int = s?.length ?: b ?: 1
val <!UNUSED_VARIABLE!>g<!>: Int? = e? startsWith("s")?.length
}
}
fun String.startsWith(<!UNUSED_PARAMETER!>s<!>: String): Boolean = true
@@ -191,12 +191,6 @@ public class ClassGenTest extends CodegenTestCase {
// System.out.println(generateToText());
}
public void testKt344 () throws Exception {
loadFile("regressions/kt344.jet");
// System.out.println(generateToText());
blackBox();
}
public void testKt508 () throws Exception {
loadFile("regressions/kt508.jet");
// System.out.println(generateToText());
@@ -26,10 +26,6 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
assertThrows(foo, Exception.class, null, new StringBuilder());
}
public void testGeneric() throws Exception {
blackBoxFile("extensionFunctions/generic.jet");
}
public void testVirtual() throws Exception {
blackBoxFile("extensionFunctions/virtual.jet");
}
@@ -503,19 +503,6 @@ public class NamespaceGenTest extends CodegenTestCase {
assertEquals("aaa", tuple4._3);
}
public void testPredicateOperator() throws Exception {
loadText("fun foo(s: String) = s?startsWith(\"J\")");
final Method main = generateFunction();
try {
assertEquals("JetBrains", main.invoke(null, "JetBrains"));
assertNull(main.invoke(null, "IntelliJ"));
}
catch (Throwable t) {
// System.out.println(generateToText());
t.printStackTrace();
}
}
public void testEscapeSequence() throws Exception {
loadText("fun foo() = \"a\\nb\\$\"");
final Method main = generateFunction();
@@ -4,6 +4,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.compiler.CompileEnvironment;
import org.jetbrains.jet.compiler.CompileSession;
import java.lang.reflect.Method;
/**
* @author alex.tkachman
*/
@@ -83,4 +85,29 @@ public class StdlibTest extends CodegenTestCase {
public void testKt274 () {
// blackBoxFile("regressions/kt274.kt");
}
//from ClassGenTest
public void testKt344 () throws Exception {
loadFile("regressions/kt344.jet");
// System.out.println(generateToText());
blackBox();
}
//from ExtensionFunctionsTest
public void testGeneric() throws Exception {
blackBoxFile("extensionFunctions/generic.jet");
}
//from NamespaceGenTest
public void testPredicateOperator() throws Exception {
loadText("fun foo(s: String) = s?startsWith(\"J\")");
final Method main = generateFunction();
try {
assertEquals("JetBrains", main.invoke(null, "JetBrains"));
assertNull(main.invoke(null, "IntelliJ"));
} catch (Throwable t) {
// System.out.println(generateToText());
t.printStackTrace();
}
}
}