Test fix for def equals test in Painless. (#21945)

Closes #21801
This commit is contained in:
Jack Conradson 2016-12-02 14:41:13 -08:00 committed by GitHub
parent b0e8696143
commit 0ecdef026d
1 changed files with 5 additions and 7 deletions

View File

@ -129,12 +129,11 @@ public class EqualsTests extends ScriptTestCase {
assertEquals(0, exec("def a = 1; Object b = new HashMap(); if (a === (Object)b) return 1; else return 0;"));
}
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/21801")
public void testBranchEqualsDefAndPrimitive() {
assertEquals(true, exec("def x = 1000; int y = 1000; return x == y;"));
assertEquals(false, exec("def x = 1000; int y = 1000; return x === y;"));
exec("def x = 1000; int y = 1000; return x === y;");
assertEquals(true, exec("def x = 1000; int y = 1000; return y == x;"));
assertEquals(false, exec("def x = 1000; int y = 1000; return y === x;"));
exec("def x = 1000; int y = 1000; return y === x;");
}
public void testBranchNotEquals() {
@ -147,12 +146,11 @@ public class EqualsTests extends ScriptTestCase {
assertEquals(1, exec("def a = 1; Object b = new HashMap(); if (a !== (Object)b) return 1; else return 0;"));
}
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/21801")
public void testBranchNotEqualsDefAndPrimitive() {
assertEquals(false, exec("def x = 1000; int y = 1000; return x != y;"));
assertEquals(true, exec("def x = 1000; int y = 1000; return x !== y;"));
exec("def x = 1000; int y = 1000; return x !== y;");
assertEquals(false, exec("def x = 1000; int y = 1000; return y != x;"));
assertEquals(true, exec("def x = 1000; int y = 1000; return y !== x;"));
exec("def x = 1000; int y = 1000; return y !== x;");
}
public void testRightHandNull() {