Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 250f090

Browse files
committed
test pair
1 parent 55fc964 commit 250f090

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎test_code.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from code import ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX
77
from code import ADD, INC, MUL, POW, DEC, SUB
88
from code import ISZERO, GTE, LTE, GT, LT, EQ
9+
from code import CONS, CAR, CDR
910
from code import make_number
1011

1112

@@ -159,5 +160,11 @@ def test_eq(left, right, expected):
159160
assert EQ(left)(right) is expected
160161

161162

163+
def test_pair():
164+
c = CONS(16)(42)
165+
assert CAR(c) == 16
166+
assert CDR(c) == 42
167+
168+
162169
if __name__ == '__main__':
163170
pytest.main()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /