* Test the concat function with arguments of various types
* @throws Exception if an error occurs
*/
public void testConcatDifferentTypes() throws Exception {
Value one = factory.createIntValue(1);
context.getCurrentScope().declareVariable(
new ImmutableExpandedName("", "myVar"),
one);
context.getCurrentScope().declareVariable(
new ImmutableExpandedName("", "emptySeq"),
Sequence.EMPTY);
context.getCurrentScope().declareVariable(
new ImmutableExpandedName("", "singleSeq"),
factory.createSequence(new Item[]
{factory.createStringValue("one")}));
Expression exp = compileExpression(
"concat(true(), 25.9, $emptySeq, $myVar, $singleSeq)");
Value result = exp.evaluate(context);
assertTrue("fn:concat should result in a String value",
result instanceof StringValue);
assertEquals("fn:concat expression result should be 'true25.91one'",