KT-1306123.lng or 123.sht is not good name

This commit is contained in:
Andrey Breslav
2012-02-20 21:42:13 +04:00
parent 5eb483b7a7
commit bff62484b1
68 changed files with 233 additions and 220 deletions
@@ -285,7 +285,7 @@ public class ArrayGenTest extends CodegenTestCase {
public void testLongDouble () throws Exception {
loadText(
"fun box() : Int { var l = IntArray(1); l[0.lng] = 4; l[0.lng] += 6; return l[0.lng];}\n" +
"fun box() : Int { var l = IntArray(1); l[0.long] = 4; l[0.long] += 6; return l[0.long];}\n" +
"fun IntArray.set(index: Long, elem: Int) { this[index.int] = elem }\n" +
"fun IntArray.get(index: Long) = this[index.int]");
// System.out.println(generateToText());
@@ -378,7 +378,7 @@ public class NamespaceGenTest extends CodegenTestCase {
}
public void testArrayAugAssignLong() throws Exception {
loadText("fun foo(c: LongArray) { c[0] *= 2.lng }");
loadText("fun foo(c: LongArray) { c[0] *= 2.long }");
// System.out.println(generateToText());
final Method main = generateFunction();
long[] data = new long[] { 5 };
@@ -154,13 +154,13 @@ public class PrimitiveTypesTest extends CodegenTestCase {
}
public void testCastConstant() throws Exception {
loadText("fun foo(): Double = 1.dbl");
loadText("fun foo(): Double = 1.double");
final Method main = generateFunction();
assertEquals(1.0, main.invoke(null));
}
public void testCastOnStack() throws Exception {
loadText("fun foo(): Double = System.currentTimeMillis().dbl");
loadText("fun foo(): Double = System.currentTimeMillis().double");
final Method main = generateFunction();
double currentTimeMillis = (double) System.currentTimeMillis();
double result = (Double) main.invoke(null);
@@ -327,7 +327,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
}
public void testKt737() throws Exception {
loadText("fun box() = if(3.compareTo(2) != 1) \"fail\" else if(5.byt.compareTo(10.lng) >= 0) \"fail\" else \"OK\"");
loadText("fun box() = if(3.compareTo(2) != 1) \"fail\" else if(5.byte.compareTo(10.long) >= 0) \"fail\" else \"OK\"");
assertEquals("OK", blackBox());
}
@@ -58,7 +58,7 @@ public class VarArgTest extends CodegenTestCase {
}
public void testNullableIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
loadText("fun test() = testf(239.byt, 7.byt); fun testf(vararg ts: Byte?) = ts");
loadText("fun test() = testf(239.byte, 7.byte); fun testf(vararg ts: Byte?) = ts");
// System.out.println(generateToText());
final Method main = generateFunction("test");
Object res = main.invoke(null);
@@ -160,11 +160,11 @@ public class JetOverloadTest extends JetLiteFixture {
FunctionDescriptor a = makeFunction(funA);
FunctionDescriptor b = makeFunction(funB);
{
OverloadUtil.OverloadCompatibilityInfo overloadableWith = OverloadUtil.isOverloadble(a, b);
OverloadUtil.OverloadCompatibilityInfo overloadableWith = OverloadUtil.isOverloadable(a, b);
assertEquals(overloadableWith.getMessage(), expectedIsError, !overloadableWith.isSuccess());
}
{
OverloadUtil.OverloadCompatibilityInfo overloadableWith = OverloadUtil.isOverloadble(b, a);
OverloadUtil.OverloadCompatibilityInfo overloadableWith = OverloadUtil.isOverloadable(b, a);
assertEquals(overloadableWith.getMessage(), expectedIsError, !overloadableWith.isSuccess());
}
}
@@ -79,14 +79,14 @@ public class JetTypeCheckerTest extends JetLiteFixture {
assertType("0b1", library.getIntType());
assertType("0B1", library.getIntType());
assertType("1.lng", library.getLongType());
assertType("1.long", library.getLongType());
assertType("1.0", library.getDoubleType());
assertType("1.0.dbl", library.getDoubleType());
assertType("1.0.double", library.getDoubleType());
assertType("0x1.fffffffffffffp1023", library.getDoubleType());
assertType("1.0.flt", library.getFloatType());
assertType("0x1.fffffffffffffp1023.flt", library.getFloatType());
assertType("1.0.float", library.getFloatType());
assertType("0x1.fffffffffffffp1023.float", library.getFloatType());
assertType("true", library.getBooleanType());
assertType("false", library.getBooleanType());
@@ -400,53 +400,53 @@ public class JetTypeCheckerTest extends JetLiteFixture {
assertType("f()", "Unit");
assertType("f(1)", "Int");
assertType("f(1.flt, 1)", "Float");
assertType("f<String>(1.flt)", "String");
assertType("f(1.float, 1)", "Float");
assertType("f<String>(1.float)", "String");
}
public void testPlus() throws Exception {
assertType("1.0.plus(1.dbl)", "Double");
assertType("1.0.plus(1.flt)", "Double");
assertType("1.0.plus(1.lng)", "Double");
assertType("1.0.plus(1.double)", "Double");
assertType("1.0.plus(1.float)", "Double");
assertType("1.0.plus(1.long)", "Double");
assertType("1.0.plus(1)", "Double");
assertType("1.flt.plus(1.dbl)", "Double");
assertType("1.flt.plus(1.flt)", "Float");
assertType("1.flt.plus(1.lng)", "Float");
assertType("1.flt.plus(1)", "Float");
assertType("1.float.plus(1.double)", "Double");
assertType("1.float.plus(1.float)", "Float");
assertType("1.float.plus(1.long)", "Float");
assertType("1.float.plus(1)", "Float");
assertType("1.lng.plus(1.dbl)", "Double");
assertType("1.lng.plus(1.flt)", "Float");
assertType("1.lng.plus(1.lng)", "Long");
assertType("1.lng.plus(1)", "Long");
assertType("1.long.plus(1.double)", "Double");
assertType("1.long.plus(1.float)", "Float");
assertType("1.long.plus(1.long)", "Long");
assertType("1.long.plus(1)", "Long");
assertType("1.plus(1.dbl)", "Double");
assertType("1.plus(1.flt)", "Float");
assertType("1.plus(1.lng)", "Long");
assertType("1.plus(1.double)", "Double");
assertType("1.plus(1.float)", "Float");
assertType("1.plus(1.long)", "Long");
assertType("1.plus(1)", "Int");
assertType("'1'.plus(1.dbl)", "Double");
assertType("'1'.plus(1.flt)", "Float");
assertType("'1'.plus(1.lng)", "Long");
assertType("'1'.plus(1.double)", "Double");
assertType("'1'.plus(1.float)", "Float");
assertType("'1'.plus(1.long)", "Long");
assertType("'1'.plus(1)", "Int");
assertType("'1'.minus('1')", "Int"); // Plus is not available for char
assertType("(1:Short).plus(1.dbl)", "Double");
assertType("(1:Short).plus(1.flt)", "Float");
assertType("(1:Short).plus(1.lng)", "Long");
assertType("(1:Short).plus(1.double)", "Double");
assertType("(1:Short).plus(1.float)", "Float");
assertType("(1:Short).plus(1.long)", "Long");
assertType("(1:Short).plus(1)", "Int");
assertType("(1:Short).plus(1:Short)", "Int");
assertType("(1:Byte).plus(1.dbl)", "Double");
assertType("(1:Byte).plus(1.flt)", "Float");
assertType("(1:Byte).plus(1.lng)", "Long");
assertType("(1:Byte).plus(1.double)", "Double");
assertType("(1:Byte).plus(1.float)", "Float");
assertType("(1:Byte).plus(1.long)", "Long");
assertType("(1:Byte).plus(1)", "Int");
assertType("(1:Byte).plus(1:Short)", "Int");
assertType("(1:Byte).plus(1:Byte)", "Int");
assertType("\"1\".plus(1.dbl)", "String");
assertType("\"1\".plus(1.flt)", "String");
assertType("\"1\".plus(1.lng)", "String");
assertType("\"1\".plus(1.double)", "String");
assertType("\"1\".plus(1.float)", "String");
assertType("\"1\".plus(1.long)", "String");
assertType("\"1\".plus(1)", "String");
assertType("\"1\".plus('1')", "String");
}