Esempio n. 1
0
def test_unit_remove_multi_level():
    a = Tuple[Tuple[Uint[1], Unit, Uint[2]], Unit, Uint[3]]
    assert flatten(a, lvl=2) == Tuple[Uint[1], Uint[2], Uint[3]]
Esempio n. 2
0
def test_unit_remove_single_level():
    a = Tuple[Tuple[Uint[1], Unit, Uint[2]], Unit, Uint[3]]
    assert flatten(a) == Tuple[Uint[1], Unit, Uint[2], Uint[3]]
Esempio n. 3
0
def test_vanish():
    a = Tuple[Tuple[Unit, Tuple[Unit]]]
    assert flatten(a, lvl=2) == Unit
Esempio n. 4
0
def test_complex():
    a = Tuple[Tuple[Uint[1], Unit, Tuple[Tuple[Uint[2]]]], Tuple[Unit],
              Uint[3]]
    assert flatten(a, lvl=2) == Tuple[Uint[1], Tuple[Uint[2]], Uint[3]]
Esempio n. 5
0
def test_resolve_multi_level():
    a = Tuple[Tuple[Uint[1]]]
    assert flatten(a, lvl=2) == Uint[1]
Esempio n. 6
0
def test_resolve_single_level():
    a = Tuple[Tuple[Tuple[Uint[1]]]]
    assert flatten(a) == Tuple[Uint[1]]