;;; File: ;;; cd-tests.ss ;;; Contents: ;;; Some simple tests of the CD database stuff ;;; Author: ;;; Samuel A. Rebelsky ;;; Version: ;;; 1.0 of October 2000 (load "cds.ss") (load "cd-utils.ss") ;;; Print information about a test ;;; Parameters: ;;; A string that describes the test ;;; The result of the test ;;; Preconditions: ;;; Standard output available for printing. ;;; Postconditions: ;;; Printed something ;;; Returns: ;;; Absolutely nothing (define test-report (lambda (description output) (display "********************") (newline) (display description) (newline) (display output) (newline) (newline))) ;;; Test of problem 3 (test-report "Here's the list of CD's" samscds) ;;; Tests of problem 4 (test-report "Sam's CDs by The Who" (search-cd 'artist "The Who" samscds)) (test-report "Sam's CDs by Van Morrison" (search-cd 'artist "Van Morrison" samscds)) (test-report "Sam's CDs by Kansas (none)" (search-cd 'artist "Kansas" samscds)) (test-report "Sam's Folk CDs" (search-cd 'genre "Folk" samscds)) (test-report "Sam's Blues CDs" (search-cd 'genre "Blues" samscds)) (test-report "Sam's Heavy Metal CDs" (search-cd 'genre "Heavy Metal" samscds)) (test-report "Sam's CDs with title 'BBC Sessions'" (search-cd 'title "BBC Sessions" samscds)) ;;; Test of problem 5 (test-report "Entry for The Who Sell Out" (search-artist-title "The Who" "The Who Sell Out" samscds)) (test-report "Entry for Bonzo Goes to Bitburg" (search-artist-title "The Ramones" "Bonzo Goes to Bitburg" samscds)) (test-report "Entry for the Blasters' BBC Sessions" ; Ok title, no artist (search-artist-title "The Blasters" "BBC Sessions" samscds)) ;;; Tests of problem 6 (test-report "CDs containing 'The Kind of Love You Never Recover From'" (search-songs "The Kind of Love You Never Recover From" samscds)) (test-report "CDs containing 'Mary Anne with the Shaky Hand'" (search-songs "Mary Anne with the Shaky Hand" samscds)) (test-report "CDs contatining 'Foo Bar'" (search-songs "Foo Bar" samscds))