;;; File: ;;; registrar-tests.ss ;;; Contents: ;;; Some simple tests of the registrar stuff from exam 1 ;;; Author: ;;; Samuel A. Rebelsky ;;; Version: ;;; 1.0 of October 2000 (load "students.ss") (load "registrar.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 7 (test-report "All students" students) ;;; Test of problem 8 helper (test-report "Sarah Schemer's Entry" (find-student "Sarah Schemer" students)) (test-report "Steven Schemer's Entry" (find-student "Steven Schemer" students)) (test-report "Sam Rebelsky's Entry" (find-student "Sam Rebelsky" students)) (test-report "John Doe's nonexistant Entry" (find-student "John Doe" students)) ;;; Test of problems 8 and problem 9 are covered by problem 10 (test-report "Info on Sarah Schemer" (summarize-student "Sarah Schemer")) (test-report "Info on Steven Schemer" (summarize-student "Steven Schemer")) (test-report "Info on Sam Rebelsky" (summarize-student "Sam Rebelsky")) (display "About to crash and burn") (newline) (test-report "Info on John Doe" (summarize-student "John Doe"))