diff options
Diffstat (limited to 'tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InvocationOnCollectionExpressionTest.java')
-rw-r--r-- | tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InvocationOnCollectionExpressionTest.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InvocationOnCollectionExpressionTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InvocationOnCollectionExpressionTest.java new file mode 100644 index 00000000..3cc2d3d6 --- /dev/null +++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InvocationOnCollectionExpressionTest.java @@ -0,0 +1,32 @@ +/* +Copyright (c) 2008 Arno Haase. +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl-v10.html + +Contributors: + Arno Haase - initial API and implementation + */ +package org.eclipse.xtend.backend.expr; + +import static org.eclipse.xtend.backend.helpers.BackendTestHelper.SOURCE_POS; +import static org.eclipse.xtend.backend.helpers.BackendTestHelper.createEmptyExecutionContext; +import static org.eclipse.xtend.backend.helpers.BackendTestHelper.createLiteral; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; + +import org.junit.Test; + + +/** + * + * @author Arno Haase (http://www.haase-consulting.com) + */ +public class InvocationOnCollectionExpressionTest { + @Test public void testInvocation () { + assertEquals (Arrays.asList (3L, 4L, 5L), new InvocationOnCollectionExpression (createLiteral (Arrays.asList(1L, 2L, 3L)), "operatorPlus", Arrays.asList (createLiteral (2L)), SOURCE_POS).evaluate (createEmptyExecutionContext ())); + assertEquals (null, new InvocationOnCollectionExpression (createLiteral (null), "operatorPlus", Arrays.asList (createLiteral (2L)), SOURCE_POS).evaluate (createEmptyExecutionContext ())); + } +} |