use of org.eclipse.xtext.xbase.typesystem.arguments.IFeatureCallArgumentSlot in project xtext-xtend by eclipse.
the class AssignmentFeatureCallArgumentsTest method test_02.
@Test
public void test_02() {
final AssignmentFeatureCallArguments arguments = this.toArguments("String s", "\"\"");
Assert.assertTrue(arguments.hasUnprocessedArguments());
Assert.assertEquals(1, arguments.getArgumentCount());
final IFeatureCallArgumentSlot singleSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertEquals("String", singleSlot.getDeclaredType().getSimpleName());
Assert.assertFalse(singleSlot.isVarArg());
Assert.assertFalse(singleSlot.isSuperfluous());
XExpression _argumentExpression = singleSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression instanceof XStringLiteral));
singleSlot.markProcessed();
Assert.assertFalse(arguments.hasUnprocessedArguments());
}
use of org.eclipse.xtext.xbase.typesystem.arguments.IFeatureCallArgumentSlot in project xtext-xtend by eclipse.
the class AssignmentFeatureCallArgumentsTest method test_01.
@Test
public void test_01() {
final AssignmentFeatureCallArguments arguments = this.toArguments("", "null");
Assert.assertTrue(arguments.hasUnprocessedArguments());
final IFeatureCallArgumentSlot singleSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertNull(singleSlot.getDeclaredType());
Assert.assertFalse(singleSlot.isVarArg());
Assert.assertFalse(singleSlot.isSuperfluous());
XExpression _argumentExpression = singleSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression instanceof XNullLiteral));
singleSlot.markProcessed();
Assert.assertFalse(arguments.hasUnprocessedArguments());
}
use of org.eclipse.xtext.xbase.typesystem.arguments.IFeatureCallArgumentSlot in project xtext-xtend by eclipse.
the class ReorderedFeatureCallArgumentsTest method test_02.
@Test
public void test_02() {
final IFeatureCallArguments arguments = this.toArgumentsWithReceiver("String s, int i", "[], 1");
Assert.assertEquals(3, arguments.getArgumentCount());
Assert.assertTrue(arguments.hasUnprocessedArguments());
final IFeatureCallArgumentSlot firstSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertFalse(firstSlot.isVarArg());
Assert.assertFalse(firstSlot.isSuperfluous());
XExpression _argumentExpression = firstSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression instanceof XNumberLiteral));
Assert.assertEquals("int", firstSlot.getDeclaredType().getSimpleName());
Assert.assertTrue(arguments.isProcessed(0));
Assert.assertFalse(arguments.isProcessed(1));
firstSlot.markProcessed();
Assert.assertTrue(arguments.isProcessed(1));
Assert.assertTrue(arguments.hasUnprocessedArguments());
final IFeatureCallArgumentSlot secondSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertFalse(secondSlot.isVarArg());
Assert.assertFalse(secondSlot.isSuperfluous());
XExpression _argumentExpression_1 = secondSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression_1 instanceof XClosure));
Assert.assertEquals("String", secondSlot.getDeclaredType().getSimpleName());
Assert.assertFalse(arguments.isProcessed(2));
secondSlot.markProcessed();
Assert.assertTrue(arguments.isProcessed(2));
Assert.assertFalse(arguments.hasUnprocessedArguments());
}
use of org.eclipse.xtext.xbase.typesystem.arguments.IFeatureCallArgumentSlot in project xtext-xtend by eclipse.
the class ReorderedVarArgFeatureCallArgumentsTest method test_02.
@Test
public void test_02() {
final IFeatureCallArguments arguments = this.toArgumentsWithReceiver("String s, int i", "[], 1");
Assert.assertEquals(3, arguments.getArgumentCount());
Assert.assertTrue(arguments.hasUnprocessedArguments());
final IFeatureCallArgumentSlot firstSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertTrue(firstSlot.isVarArg());
Assert.assertFalse(firstSlot.isSuperfluous());
XExpression _argumentExpression = firstSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression instanceof XNumberLiteral));
Assert.assertEquals("int", firstSlot.getDeclaredType().getSimpleName());
Assert.assertTrue(arguments.isProcessed(0));
Assert.assertFalse(arguments.isProcessed(1));
firstSlot.markProcessed();
Assert.assertTrue(arguments.isProcessed(1));
Assert.assertTrue(arguments.hasUnprocessedArguments());
final IFeatureCallArgumentSlot secondSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertFalse(secondSlot.isVarArg());
Assert.assertFalse(secondSlot.isSuperfluous());
XExpression _argumentExpression_1 = secondSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression_1 instanceof XClosure));
Assert.assertEquals("String", secondSlot.getDeclaredType().getSimpleName());
Assert.assertFalse(arguments.isProcessed(2));
secondSlot.markProcessed();
Assert.assertTrue(arguments.isProcessed(2));
Assert.assertFalse(arguments.hasUnprocessedArguments());
}
use of org.eclipse.xtext.xbase.typesystem.arguments.IFeatureCallArgumentSlot in project xtext-xtend by eclipse.
the class StandardFeatureCallArgumentsTest method test_03.
@Test
public void test_03() {
final IFeatureCallArguments arguments = this.toArgumentsWithoutReceiver("String s", "\"\"");
Assert.assertTrue(arguments.hasUnprocessedArguments());
Assert.assertEquals(1, arguments.getArgumentCount());
final IFeatureCallArgumentSlot singleSlot = arguments.getNextUnprocessedArgumentSlot();
Assert.assertFalse(singleSlot.isVarArg());
Assert.assertFalse(singleSlot.isSuperfluous());
XExpression _argumentExpression = singleSlot.getArgumentExpression();
Assert.assertTrue((_argumentExpression instanceof XStringLiteral));
Assert.assertEquals("String", singleSlot.getDeclaredType().getSimpleName());
singleSlot.markProcessed();
Assert.assertFalse(arguments.hasUnprocessedArguments());
}
Aggregations