Esempio n. 1
0
def typeset_matching():
    numeric = typeset.typeset([int_, longlong])
    n = numeric(numeric, numeric)
    f = numba.floating(numba.floating, numba.floating)

    signatures = [n, f, object_(object_, object_)]
    ts = typeset.typeset(signatures)

    assert ts.find_match(promote, [float_, float_]) == s(float_)
    assert ts.find_match(promote, [float_, double]) == s(double)
    assert ts.find_match(promote, [longdouble, float_]) == s(longdouble)

    assert ts.find_match(promote, [int_, int_]) == s(int_)
Esempio n. 2
0
def test_typeset_matching():
    numeric = typeset.typeset([int_, longlong])
    n = numeric(numeric, numeric)
    f = numba.floating(numba.floating, numba.floating)

    signatures = [n, f, object_(object_, object_)]
    ts = typeset.typeset(signatures)

    assert ts.find_match(context, [float_, float_]) == s(float_)
    assert ts.find_match(context, [float_, double]) == s(double)
    assert ts.find_match(context, [longdouble, float_]) == s(longdouble)

    assert ts.find_match(context, [int_, int_]) == s(int_)
    assert ts.find_match(context, [int_, longlong]) == s(longlong)
    assert ts.find_match(context, [short, int_]) == s(int_)

    assert ts.find_match(context, [short, ulonglong]) is None
Esempio n. 3
0
def test_typeset_matching():
    context = NumbaEnvironment.get_environment().context

    numeric = typeset.typeset([int_, longlong])
    n = numeric(numeric, numeric)
    f = numba.floating(numba.floating, numba.floating)

    signatures = [n, f, object_(object_, object_)]
    ts = typeset.typeset(signatures)

    assert ts.find_match(context, [float_, float_]) == s(float_)
    assert ts.find_match(context, [float_, double]) == s(double)
    assert ts.find_match(context, [longdouble, float_]) == s(longdouble)

    assert ts.find_match(context, [int_, int_]) == s(int_)
    assert ts.find_match(context, [int_, longlong]) == s(longlong)
    assert ts.find_match(context, [short, int_]) == s(int_)

    assert ts.find_match(context, [short, ulonglong]) is None