add simple arguments test
This commit is contained in:
parent
28b1b149ab
commit
006829e89b
|
@ -162,6 +162,15 @@ public class CastTests extends ScriptTestCase {
|
||||||
assertEquals(5, exec("def x = 5; return (int)x.longValue();"));
|
assertEquals(5, exec("def x = 5; return (int)x.longValue();"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Currently these do not adopt the argument value, we issue a separate cast!
|
||||||
|
*/
|
||||||
|
public void testArgumentsDef() {
|
||||||
|
assertEquals(5, exec("def x = 5L; return (+(int)x);"));
|
||||||
|
assertEquals(6, exec("def x = 5; def y = 1L; return x + (int)y"));
|
||||||
|
assertEquals('b', exec("def x = 'abcdeg'; def y = 1L; x.charAt((int)y)"));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unary operators adopt the return value
|
* Unary operators adopt the return value
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue