Exemplo n.º 1
0
def take_curry_test():
    assert_iterables_equal(
        zip_obj(['a', 'b', 'c'])([1, 2, 3]), {
            'a': 1,
            'b': 2,
            'c': 3
        })
Exemplo n.º 2
0
def test_take_curry():
    assert_iterables_equal(
        zip_obj(["a", "b", "c"])([1, 2, 3]), {
            "a": 1,
            "b": 2,
            "c": 3
        })
Exemplo n.º 3
0
def test_append_curry():
    assert_iterables_equal(append(3)([1, 2]), [1, 2, 3])
Exemplo n.º 4
0
def test_drop_curry():
    assert_iterables_equal(drop(2)([1, 2, 3, 4]), [3, 4])
Exemplo n.º 5
0
def values_test():
    assert_iterables_equal(set(values(test_dict)), set([1, 3, 2]))
Exemplo n.º 6
0
def cons_nocurry_test():
    assert_iterables_equal(adjust(add_one, 1, [2, 3]), [2, 4])
Exemplo n.º 7
0
def uniq_nocurry_test():
    assert_iterables_equal(uniq([1, 2, 3, 3, 4]), [1, 2, 3, 4])
Exemplo n.º 8
0
def values_test():
    assert_iterables_equal(values(test_dict), [1, 2, 3])
Exemplo n.º 9
0
def aperture_curry_test():
    assert_iterables_equal(aperture(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])
Exemplo n.º 10
0
def test_uniq_nocurry():
    assert_iterables_equal(times(identity, 5), [0, 1, 2, 3, 4])
    assert_iterables_equal(times(identity)(5), [0, 1, 2, 3, 4])
Exemplo n.º 11
0
def cons_curry_test():
    assert_iterables_equal(update(1, 1)([2, 3]), [2, 1])
Exemplo n.º 12
0
def test_uniq_nocurry():
    assert_iterables_equal(zip_with(add, [1, 1, 1], [1, 2, 3]), [2, 3, 4])
Exemplo n.º 13
0
def cons_curry_test():
    assert_iterables_equal(cons(1)([2, 3]), [1, 2, 3])
Exemplo n.º 14
0
def test_take_curry():
    assert_iterables_equal(zip_with(add)([1, 1, 1], [1, 2, 3]), [2, 3, 4])
Exemplo n.º 15
0
def test_cons_nocurry():
    assert_iterables_equal(update(1, 1, [2, 3]), [2, 1])
    assert_iterables_equal(update(-1, "_", ["a", "b", "c"]), ["a", "b", "_"])
Exemplo n.º 16
0
def chain_curry_test():
    assert_iterables_equal(chain(to_two)([1, 2, 3]), [1, 1, 2, 2, 3, 3])
Exemplo n.º 17
0
def test_chain_nocurry():
    assert_iterables_equal(chain(to_two, [1, 2, 3]), [1, 1, 2, 2, 3, 3])
Exemplo n.º 18
0
def test_cons_curry():
    assert_iterables_equal(cons(1)([2, 3]), [1, 2, 3])
Exemplo n.º 19
0
def drop_curry_test():
    assert_iterables_equal(drop(2)([1, 2, 3, 4]), [3, 4])
Exemplo n.º 20
0
def uniq_nocurry_test():
    assert_iterables_equal(xprod([1, 2], ['a', 'b']), [
                           [1, 'a'], [2, 'a'], [1, 'b'], [2, 'b']])
Exemplo n.º 21
0
def aperture_curry_test():
    assert_iterables_equal(aperture(10)([1, 2, 3, 4, 5]), [])
Exemplo n.º 22
0
def test_uniq_nocurry():
    assert_iterables_equal(xprod([1, 2], ["a", "b"]),
                           [[1, "a"], [2, "a"], [1, "b"], [2, "b"]])
Exemplo n.º 23
0
def test_uniq_nocurry():
    assert_iterables_equal(uniq([1, 2, 3, 3, 4]), [1, 2, 3, 4])
Exemplo n.º 24
0
def map_nocurry_test():
    assert_iterables_equal(map(add1, [1, 2, 3]), [2, 3, 4])
Exemplo n.º 25
0
def take_curry_test():
    assert_iterables_equal(xprod([1, 2])(['a', 'b']), [
                           [1, 'a'], [2, 'a'], [1, 'b'], [2, 'b']])
Exemplo n.º 26
0
def uniq_nocurry_test():
    assert_iterables_equal(zip_obj(['a', 'b', 'c'], [1, 2, 3]), {
        'a': 1,
        'b': 2,
        'c': 3
    })
Exemplo n.º 27
0
def test_take_curry():
    assert_iterables_equal(
        xprod([1, 2])(["a", "b"]), [[1, "a"], [2, "a"], [1, "b"], [2, "b"]])
Exemplo n.º 28
0
def test_uniq_nocurry():
    assert_iterables_equal(zip_obj(["a", "b", "c"], [1, 2, 3]), {
        "a": 1,
        "b": 2,
        "c": 3
    })
Exemplo n.º 29
0
def uniq_nocurry_test():
    assert_iterables_equal(times(5), [1, 2, 3, 4])
Exemplo n.º 30
0
def drop_nocurry_test():
    assert_iterables_equal(drop_last(2, [1, 2, 3, 4]), [1, 2])