diff --git a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/I.java b/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/I.java deleted file mode 100644 index 4a441f96b..000000000 --- a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/I.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.robovm.rt.lambdas.test004; - -interface I { - int addOutsideValue(); -} diff --git a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Lambda.java b/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Lambda.java deleted file mode 100644 index 2976b5ede..000000000 --- a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Lambda.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.robovm.rt.lambdas.test004; - - -/** - * Test casting lambda expression. - */ -public class Lambda { - - private int field; - - public Lambda(int value) { - this.field = value; - } - - public int testAdd(int a) { - return ((I)() -> a + field).addOutsideValue(); - } -} \ No newline at end of file diff --git a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Test04_Casting.java b/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Test04_Casting.java new file mode 100644 index 000000000..e1411f724 --- /dev/null +++ b/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Test04_Casting.java @@ -0,0 +1,17 @@ +package org.robovm.rt.lambdas.test004; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +interface I { + int add(); +} + +public class Test04_Casting { + + @Test + public void test004() { + assertEquals(10, ((I)()->10).add()); + } +} diff --git a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Tests.java b/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Tests.java deleted file mode 100644 index f0142e506..000000000 --- a/tests/robovm/src/test/java/org/robovm/rt/lambdas/test004/Tests.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.robovm.rt.lambdas.test004; - -import org.junit.Assert; -import org.junit.Test; - -/** - * Test casting lambda expression. - */ -public class Tests { - - @Test - public void test001() { - Lambda lambda = new Lambda(5); - Assert.assertEquals(10, lambda.testAdd(5)); - Assert.assertEquals(8, lambda.testAdd(3)); - } -}