previous | index | next

Exercise 7.34 – matches?

Before querying the database, the test file will make sure your new matches? predicate works correctly by running these tests:
(assert (equal? (matches?-for-7.34 '(a b ...) 
                                   '(a b c d e))
                #t))

(assert (equal? (matches?-for-7.34 '(a b ... e) 
                                   '(a b c d e))
                #t))

(assert (equal? (matches?-for-7.34 '(a b ... e) 
                                   '(a b c d f))
                #f))

(assert (equal? (matches?-for-7.34 '(a b ... e) 
                                   '(a b 1 2 3 4 5 e))
                #t))

(assert (equal? (matches?-for-7.34 '(a b ... e) 
                                   '(a b 1 2 3 f))
                #f))

(assert (equal? (matches?-for-7.34 '(a b ... e _ (x y)) 
                                   '(a b 1 2 3 4 5 e foo y))
                #t))

previous | index | next