mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Some tests on java.lang.Object added
This commit is contained in:
parent
f88b868c39
commit
cf6c9b1ba6
|
@ -61,7 +61,9 @@ public class ObjectNativeGenerator implements Generator, DependencyPlugin {
|
||||||
ValueType.object(classClass)));
|
ValueType.object(classClass)));
|
||||||
writer.append("cls = ").appendClass(classClass).append('.').appendMethod(createMethodRef)
|
writer.append("cls = ").appendClass(classClass).append('.').appendMethod(createMethodRef)
|
||||||
.append("();").newLine();
|
.append("();").newLine();
|
||||||
writer.append("cls.$data = ").append(thisArg).append(".$class;").newLine().outdent().append("}").newLine();
|
writer.append("cls.$data = ").append(thisArg).append(".$class;").newLine();
|
||||||
|
writer.append(thisArg).append(".$class.classObject = cls;").newLine();
|
||||||
|
writer.outdent().append("}").newLine();
|
||||||
writer.append("return cls;").newLine();
|
writer.append("return cls;").newLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,4 +27,22 @@ class TObjectTests {
|
||||||
Object b = a;
|
Object b = a;
|
||||||
assertEquals(a, b);
|
assertEquals(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void multipleGetClassCallsReturnSameValue() {
|
||||||
|
Object a = new Object();
|
||||||
|
assertSame(a.getClass(), a.getClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void sameClassesAreEqual() {
|
||||||
|
Object a = new Object();
|
||||||
|
Object b = new Object();
|
||||||
|
assertSame(a.getClass(), b.getClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void properInstanceDetected() {
|
||||||
|
assertTrue(Object.class.isInstance(new Object()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user