Skip to content

Commit

Permalink
fix test w.r.t. latest impl
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Nov 1, 2021
1 parent 5525248 commit 27f288f
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,32 +839,44 @@ public void testPrimitiveAndBoxedToObjectCasts() throws Exception {

public void testPyObjectToPrimitiveCasts() throws Exception {
String expression = "(int)myPyObject";
String resultExpression = "intPyCast((PyObject)myPyObject)";
String resultExpression = "intPyCast(myPyObject)";
check(expression, resultExpression, int.class, new String[] {"myPyObject"});

expression = "(double)myPyObject";
resultExpression = "doublePyCast((PyObject)myPyObject)";
resultExpression = "doublePyCast(myPyObject)";
check(expression, resultExpression, double.class, new String[] {"myPyObject"});

expression = "(long)myPyObject";
resultExpression = "longPyCast((PyObject)myPyObject)";
resultExpression = "longPyCast(myPyObject)";
check(expression, resultExpression, long.class, new String[] {"myPyObject"});

expression = "(float)myPyObject";
resultExpression = "floatPyCast((PyObject)myPyObject)";
resultExpression = "floatPyCast(myPyObject)";
check(expression, resultExpression, float.class, new String[] {"myPyObject"});

expression = "(char)myPyObject";
resultExpression = "charPyCast((PyObject)myPyObject)";
resultExpression = "charPyCast(myPyObject)";
check(expression, resultExpression, char.class, new String[] {"myPyObject"});

expression = "(byte)myPyObject";
resultExpression = "bytePyCast((PyObject)myPyObject)";
resultExpression = "bytePyCast(myPyObject)";
check(expression, resultExpression, byte.class, new String[] {"myPyObject"});

expression = "(short)myPyObject";
resultExpression = "shortPyCast((PyObject)myPyObject)";
resultExpression = "shortPyCast(myPyObject)";
check(expression, resultExpression, short.class, new String[] {"myPyObject"});

expression = "(String)myPyObject";
resultExpression = "doStringPyCast(myPyObject)";
check(expression, resultExpression, String.class, new String[] {"myPyObject"});

expression = "(boolean)myPyObject";
resultExpression = "booleanPyCast(myPyObject)";
check(expression, resultExpression, boolean.class, new String[] {"myPyObject"});

expression = "(Boolean)myPyObject";
resultExpression = "doBooleanPyCast(myPyObject)";
check(expression, resultExpression, Boolean.class, new String[] {"myPyObject"});
}

public void testVariables() throws Exception {
Expand Down

0 comments on commit 27f288f

Please sign in to comment.