@Test
public void testArray()
throws Exception
{
TypeManager typeManager = new TypeRegistry();
Signature signature = new Signature("get", ImmutableList.of(typeParameter("T")), "T", ImmutableList.of("array<T>"), false, true);
assertNotNull(signature.bindTypeParameters(ImmutableList.of(typeManager.getType("array<bigint>")), true, typeManager));
assertNull(signature.bindTypeParameters(ImmutableList.of(BIGINT), true, typeManager));
signature = new Signature("contains", ImmutableList.of(comparableTypeParameter("T")), "T", ImmutableList.of("array<T>", "T"), false, true);
assertNotNull(signature.bindTypeParameters(ImmutableList.of(typeManager.getType("array<bigint>"), BIGINT), true, typeManager));
assertNull(signature.bindTypeParameters(ImmutableList.of(typeManager.getType("array<bigint>"), VARCHAR), true, typeManager));
assertNull(signature.bindTypeParameters(ImmutableList.of(typeManager.getType("array<HyperLogLog>"), HYPER_LOG_LOG), true, typeManager));
signature = new Signature("foo", ImmutableList.of(typeParameter("T")), "T", ImmutableList.of("array<T>", "array<T>"), false, true);
assertNotNull(signature.bindTypeParameters(ImmutableList.of(typeManager.getType("array<bigint>"), typeManager.getType("array<bigint>")), true, typeManager));
assertNull(signature.bindTypeParameters(ImmutableList.of(typeManager.getType("array<bigint>"), typeManager.getType("array<varchar>")), true, typeManager));
}