Skip to content

Commit a00a364

Browse files
committed
Add exercise for 2-26
1 parent ca60481 commit a00a364

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

chapter2/exercise2-26.scm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
(define x (list 1 2 3))
33
(define y (list 4 5 6))
44

5-
(append x y); => (1 2 3 4 5 6)
6-
(cons x y); => ((1 2 3) 4 5 6)
7-
(list x y); => ((1 2 3) (4 5 6))
5+
(module+ test
6+
(require rackunit)
7+
8+
(test-case "Test for append, cons, and list"
9+
(check-equal? (append x y) '(1 2 3 4 5 6))
10+
(check-equal? (cons x y) '((1 2 3) 4 5 6))
11+
(check-equal? (list x y) '((1 2 3) (4 5 6)))
12+
)
13+
)

0 commit comments

Comments
 (0)