예제 #1
0
def test2():
    print "--<<test 2>>--"
    print "Should get us the first two (3,5)"
    x = sieve.adder()
    y = x.next()
    assert y == 3
    y = x.next()
    assert y == 5
    print "=>Success"
예제 #2
0
def test1():
    print "--<<test 1>>--"
    print "should get to one value above 29 and stop"
    x = 0
    for i in sieve.adder():
        if i > 29:
            x = i
            break
    assert x == 31
    print "=>Success"
예제 #3
0
def test3():
    print "--<<test 3>>--"
    print "will loop to one prime above 6, then one more manually by next()"
    x = sieve.adder()
    for i in x:
           if i > 6:
            break
    y = x.next()
    assert y == 11
    print "=>Success"
예제 #4
0
def test():
    s = sieve.adder()
    i = iter(s)
    assert i.next() == 3
예제 #5
0
def test():
    s = sieve.adder()
    s.next()
    s.next()
    assert s.next() == 7
예제 #6
0
import sieve

for i in sieve.adder():
	print i

	if i>= 31:
	    break