//Test that with preserveDependencies set to false (the default) that the definition is expanded appropriately
//when the outer function has differing numbers of arguments
List<Var> args = new ArrayList<Var>();
args.add(Var.alloc("x"));
args.add(Var.alloc("y"));
Expr add = new E_Add(new E_Function("http://example/single", new ExprList(new ExprVar("x"))), new ExprVar("y"));
UserDefinedFunctionFactory.getFactory().add("http://example/add", add, args);
UserDefinedFunctionDefinition def = UserDefinedFunctionFactory.getFactory().get("http://example/add");
Expr base = def.getBaseExpr();
Assert.assertTrue(base instanceof E_Add);
E_Add actual = (E_Add)base;
Assert.assertTrue(actual.getArg1() instanceof ExprVar);
Assert.assertTrue(actual.getArg2() instanceof ExprVar);
Assert.assertEquals("x", actual.getArg1().getVarName());
Assert.assertEquals("y", actual.getArg2().getVarName());
}