Esempio n. 1
0
def test_reasonable_speed(N=1000):
    d = emptyset
    for i in range(N):
        d |= FSet([i])
    checktree(d)
    assert list(d) == range(N)
    d = emptyset
    for i in range(N - 1, -1, -1):
        d |= FSet([i])
    checktree(d)
    assert list(d) == range(N)
    d = emptyset
    lst = range(N)
    random.shuffle(lst)
    for i in lst:
        d |= FSet([i])
    checktree(d)
    assert list(d) == range(N)
Esempio n. 2
0
def test_reasonable_speed(N=1000):
    d = emptyset
    for i in range(N):
        d |= FSet([i])
    checktree(d)
    assert list(d) == range(N)
    d = emptyset
    for i in range(N-1, -1, -1):
        d |= FSet([i])
    checktree(d)
    assert list(d) == range(N)
    d = emptyset
    lst = range(N)
    random.shuffle(lst)
    for i in lst:
        d |= FSet([i])
    checktree(d)
    assert list(d) == range(N)
Esempio n. 3
0
def test_empty():
    assert FSet() is FSet([]) is emptyset
    assert len(emptyset) == 0
    assert list(emptyset) == []
    checktree(emptyset)
Esempio n. 4
0
def test_new():
    s = FSet(range(6, 42) + range(13))
    assert len(s) == 42
    assert list(s) == range(42)
    assert FSet(s) is s
    checktree(s)
Esempio n. 5
0
def test_iter():
    s = FSet(range(42))
    assert len(s) == 42
    assert list(s) == range(42)
    checktree(s)
Esempio n. 6
0
def test_empty():
    assert FSet() is FSet([]) is emptyset
    assert len(emptyset) == 0
    assert list(emptyset) == []
    checktree(emptyset)
Esempio n. 7
0
def test_new():
    s = FSet(range(6, 42) + range(13))
    assert len(s) == 42
    assert list(s) == range(42)
    assert FSet(s) is s
    checktree(s)
Esempio n. 8
0
def test_iter():
    s = FSet(range(42))
    assert len(s) == 42
    assert list(s) == range(42)
    checktree(s)