示例#1
0
def test_cons():
    a = 3
    b = 4
    def pair(f):
        return f(a,b)
    result = solution.cons(a,b)
    assert isinstance(result,type(pair))
示例#2
0
def test_cdr():
    expected = 4
    result = solution.cdr(solution.cons(3,4))
    assert result == expected
示例#3
0
def test_cdr_alt():
    expected = 7
    result = solution.cdr_alt(solution.cons(8,7))
    assert result == expected
示例#4
0
def test_car():
    expected = 3
    result = solution.car(solution.cons(3,4))
    assert result == expected