Exemplo n.º 1
0
def test_option_some_map_fluent():
    xs = Some(42)
    ys = xs.map(lambda x: x + 1)

    for value in ys.match(Some):
        assert value == 43
        break
    else:
        assert False
Exemplo n.º 2
0
def test_option_some_map_fluent():
    xs = Some(42)
    ys = xs.map(lambda x: x + 1)

    assert ys.match(Some, lambda some: some.value == 43, _, False)