generate === and !==

This commit is contained in:
Dmitry Jemerov
2011-04-14 20:24:22 +02:00
parent ae4bb5d7fc
commit 8e551399a1
3 changed files with 77 additions and 28 deletions
@@ -537,6 +537,24 @@ public class NamespaceGenTest extends LightCodeInsightFixtureTestCase {
assertEquals(Boolean.FALSE, main.invoke(null, "jet"));
}
public void testTripleEq() throws Exception {
loadText("fun foo(s1: String?, s2: String?) = s1 === s2");
final Method main = generateFunction();
String s1 = new String("jet");
String s2 = new String("jet");
assertEquals(Boolean.TRUE, main.invoke(null, s1, s1));
assertEquals(Boolean.FALSE, main.invoke(null, s1, s2));
}
public void testTripleNotEq() throws Exception {
loadText("fun foo(s1: String?, s2: String?) = s1 !== s2");
final Method main = generateFunction();
String s1 = new String("jet");
String s2 = new String("jet");
assertEquals(Boolean.FALSE, main.invoke(null, s1, s1));
assertEquals(Boolean.TRUE, main.invoke(null, s1, s2));
}
public void testFunctionCall() throws Exception {
loadFile("functionCall.jet");
System.out.println(generateToText());