We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3524d8b commit 5cd2536Copy full SHA for 5cd2536
chapter2/exercise2-28.scm
@@ -3,10 +3,15 @@
3
(if (not (pair? items))
4
items
5
(if (pair? (car items))
6
- (append (fringe (car items)) (fringe (cdr items)))
7
- (append (list (car items)) (fringe (cdr items))))))
+ (append (fringe (car items)) (fringe (cdr items)))
+ (append (list (car items)) (fringe (cdr items))))))
8
9
-;;;
10
(define x (list (list 1 2) (list 3 4)))
11
-(fringe x) ; => (1 2 3 4)
12
-(fringe (list x x)) ; => (1 2 3 4 1 2 3 4)
+(module+ test
+ (require rackunit)
+
13
+ (test-case "Test for fringe"
14
+ (check-equal? (fringe x) '(1 2 3 4))
15
+ (check-equal? (fringe (list x x)) '(1 2 3 4 1 2 3 4))
16
+ )
17
0 commit comments