Exemplo n.º 1
0
def test_fast_int_converts_int_string_to_int_example():
    assert fast_int("-45") == -45
    assert fast_int("+45") == 45
    assert fast_int("۱۲") == 12
    assert fast_int("-۱۲") == -12
Exemplo n.º 2
0
def test_fast_int_leaves_string_as_is_example():
    assert fast_int('invalid') == 'invalid'
Exemplo n.º 3
0
def test_fast_int_leaves_int_asis_example():
    assert fast_int(45) == 45
Exemplo n.º 4
0
def test_fast_int_leaves_float_string_as_is_example():
    assert fast_int('45.8') == '45.8'
    assert fast_int('nan') == 'nan'
    assert fast_int('inf') == 'inf'
Exemplo n.º 5
0
def test_fast_int_converts_int_string_to_int_example():
    assert fast_int('-45') == -45
    assert fast_int('+45') == 45
Exemplo n.º 6
0
def test_fast_int_leaves_string_as_is_example():
    assert fast_int('invalid') == 'invalid'
Exemplo n.º 7
0
def test_fast_int_with_key_applies_to_string_example():
    assert fast_int('invalid', key=len) == len('invalid')
Exemplo n.º 8
0
def test_fast_int_leaves_string_as_is_example():
    assert fast_int("invalid") == "invalid"
Exemplo n.º 9
0
def test_fast_int_leaves_float_string_as_is_example():
    assert fast_int("45.8") == "45.8"
    assert fast_int("nan") == "nan"
    assert fast_int("inf") == "inf"
Exemplo n.º 10
0
def test_fast_int_leaves_float_string_as_is_example():
    assert fast_int("45.8") == "45.8"
    assert fast_int("nan") == "nan"
    assert fast_int("inf") == "inf"
Exemplo n.º 11
0
def test_fast_int_converts_int_string_to_int_example():
    assert fast_int("-45") == -45
    assert fast_int("+45") == 45
    assert fast_int("۱۲") == 12
    assert fast_int("-۱۲") == -12
Exemplo n.º 12
0
def test_fast_int_with_key_applies_to_string(x):
    assert fast_int(x, key=len) == len(x)
Exemplo n.º 13
0
def test_fast_int_leaves_string_as_is(x):
    assert fast_int(x) == x
Exemplo n.º 14
0
def test_fast_int_leaves_string_as_is_example():
    assert fast_int("invalid") == "invalid"
Exemplo n.º 15
0
def test_fast_int_converts_int_string_to_int_example():
    assert fast_int('-45') == -45
    assert fast_int('+45') == 45
Exemplo n.º 16
0
def test_fast_int_with_key_applies_to_string(x):
    assume(not is_int(x))
    assume(bool(x))
    assert fast_int(x, key=len) == len(x)
Exemplo n.º 17
0
def test_fast_int_converts_int_string_to_int(x):
    assert fast_int(repr(x)) == x
Exemplo n.º 18
0
def test_fast_int_leaves_float_string_as_is(x):
    assert fast_int(repr(x)) == repr(x)
Exemplo n.º 19
0
def test_fast_int_leaves_string_as_is(x):
    assume(not is_int(x))
    assume(bool(x))
    assert fast_int(x) == x
Exemplo n.º 20
0
def test_fast_int_leaves_string_as_is(x):
    assert fast_int(x) == x
Exemplo n.º 21
0
def test_fast_int_with_key_applies_to_string(x):
    assume(not is_int(x))
    assume(bool(x))
    assert fast_int(x, key=len) == len(x)
Exemplo n.º 22
0
def test_fast_int_with_key_applies_to_string_example():
    assert fast_int('invalid', key=len) == len('invalid')
Exemplo n.º 23
0
def test_fast_int_leaves_float_string_as_is(x):
    assume(not x.is_integer())
    assert fast_int(repr(x)) == repr(x)
Exemplo n.º 24
0
def test_fast_int_with_key_applies_to_string(x):
    assert fast_int(x, key=len) == len(x)
Exemplo n.º 25
0
def test_fast_int_converts_int_string_to_int(x):
    assert fast_int(repr(x)) == x
Exemplo n.º 26
0
def test_fast_int_leaves_float_string_as_is_example():
    assert fast_int('45.8') == '45.8'
    assert fast_int('nan') == 'nan'
    assert fast_int('inf') == 'inf'
Exemplo n.º 27
0
def test_fast_int_leaves_string_as_is(x):
    assume(not is_int(x))
    assert fast_int(x) == x
Exemplo n.º 28
0
def test_fast_int_leaves_float_string_as_is(x):
    assume(not x.is_integer())
    assert fast_int(repr(x)) == repr(x)
Exemplo n.º 29
0
def test_fast_int_leaves_int_asis(x):
    assert fast_int(x) == x
Exemplo n.º 30
0
def test_fast_int_leaves_float_string_as_is(x):
    assert fast_int(repr(x)) == repr(x)