; To help you write the tests for the 1/30 homework and to give you a ; better idea of how we test code when programming and grading, here are ; some of the tests we used for the 1/18 homework. Sang Hoon Yeo, one ; of your two TAs, wrote these test functions. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define l1 '(german chocolate cake)) (define l2 '(poppy seed cake)) (define l3 '((linzer) (torte) ())) (define l4 '((bleu cheese) (and) (red) (wine))) (define l5 '(() ())) ;; The Little Lisper exercise 2.5 >> test-function for non-lat? (define test-nonlat? (lambda () (and (not (nonlat? l1)) (not (nonlat? l2)) (nonlat? l3) (nonlat? l4) (nonlat? l5)))) ;; The Little Lisper exercise 2.6 >> test-function for member-cake? (define test-member-cake? (lambda () (and (member-cake? l1) (member-cake? l2) (not (member-cake? '())) (not (member-cake? '(poppy seed)))))) ;; The Little Lisper exercise 2.10 >> test-function for member-twice? (define test-member-twice? (lambda () (and (not (member-twice? 'a '())) (not (member-twice? 'a '(a))) (not (member-twice? 'a '(a b c d b))) (member-twice? 'a '(a c a a a)) (member-twice? 'a '(b c a d a))))) ;; Concrete Abstractions exercise 1.14 >> test-function for test-average? (define test-average (lambda () (and (= 1 (average 0 2)) (= 7.5 (average (+ 1 2) (* 3 4)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;