def test_ambiguities(): signatures = [[A], [B], [A, B], [B, A], [A, C]] expected = set([((A, B), (B, A))]) result = ambiguities(signatures) assert set(map(frozenset, expected)) == set(map(frozenset, result)) signatures = [[A], [B], [A, B], [B, A], [A, C], [B, B]] expected = set() result = ambiguities(signatures) assert set(map(frozenset, expected)) == set(map(frozenset, result))
def test_vararg_dispatch_ambiguity_in_variadic(): f = Dispatcher('f') @f.register(float, [object]) def _1(a, b, *args): return 1 @f.register(object, [float]) def _2(a, b, *args): return 2 assert ambiguities(f.funcs)
def test_no_dispatch_ambiguities(): for func in [into, compute_up, compute_down, drop, create_index]: assert not ambiguities(func.funcs)
def test_no_infer_ambiguities(): assert not ambiguities(dt.infer.funcs)
def test_no_execute_ambiguities(func): assert not ambiguities(func.funcs)
def test_no_ambiguities(): ambs = ambiguities(ibis_type_to_bigquery_type.funcs) assert not ambs
def test_no_ambiguities(): ambs = ambiguities(ibis_type_to_cloud_spanner_type.funcs) assert not ambs
def test_compute_one_non_ambiguous(): assert not ambiguities(compute_one.funcs)
def test_into_non_ambiguous(): assert not ambiguities(into.funcs)