final BytesRef expected = new BytesRef("Youri");
List<Symbol> arguments = Arrays.<Symbol>asList(
term,
termIndex
);
Function function = createFunction(SubscriptFunction.NAME, DataTypes.STRING, arguments);
SubscriptFunction subscriptFunction = (SubscriptFunction) functions.get(function.info().ident());
Symbol result = subscriptFunction.normalizeSymbol(function);
assertLiteralSymbol(result, expected.utf8ToString());
arguments = Arrays.<Symbol>asList(
createReference("text", term.valueType()),
termIndex
);
function = createFunction(SubscriptFunction.NAME, DataTypes.STRING, arguments);
subscriptFunction = (SubscriptFunction) functions.get(function.info().ident());
result = subscriptFunction.normalizeSymbol(function);
assertThat(result, instanceOf(Function.class));
assertThat((Function)result, is(function));
}