86 lines
2.7 KiB
Plaintext
86 lines
2.7 KiB
Plaintext
;; Function To Be Tested: NAME (Programmer's Assistant Command)
|
|
;;
|
|
;; Source: Xerox Common Lisp Implementation Notes (Lyric Beta Release)
|
|
;; CLtL, Section 20.2 (The Evaluator)
|
|
;; Section: The Evaluator
|
|
;; Page: 28
|
|
;;
|
|
;; Created By: John Park
|
|
;;
|
|
;; Creation Date: Feb 24, 1987
|
|
;;
|
|
;; Last Update:
|
|
;;
|
|
;; Filed As: {ERIS}<lispcore>test>exec>name.u
|
|
;;
|
|
;;
|
|
;; Syntax: NAME COMMAND-NAME &optional ARGUMENTS &rest EVENT-SPEC
|
|
;;
|
|
;; Function Description: Similar to REDO except sets the debugger parameters
|
|
;; so that any errrors that occur while executing EventSpec will cause breaks.
|
|
;;
|
|
;; Argument(s): Command-Name, Arguments, and Event-Spec
|
|
;;
|
|
;; Returns: See function description
|
|
;;
|
|
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
|
;; testing them willbe accomplished by using the interlisp function bksysbuf
|
|
;; in do-test form. Comments are incorporated within each command file.
|
|
;; Each test setup is titled "NAME-TEST-SETUP", which executes the command
|
|
;; string. The do-test form within the command file will return T or "test "quote"
|
|
;; failed in file "unknown". " This test file requires TEDIT package.
|
|
;; The test result will be logged automatically in the following file:
|
|
;; {ERIS}<lispcore>test>exec>test.report
|
|
;;
|
|
;; Messages will be printed before each command in the command files is executed
|
|
;; for user monitoring. Test result is logged on
|
|
;; {eris}<lispcore>test>exec>test.report.
|
|
|
|
(DO-TEST "NAME-TEST-SETUP"
|
|
(PROGN
|
|
(SETQ MESS0 "Setting the variable today-1...")
|
|
(SETQ MESS1 "Defining a new command DATE using DA...")
|
|
(SETQ MESS2 "Setting and resetting FOO...")
|
|
(SETQ MESS3 "Defining a new command called Foo-2, which will return the value assigned when foo was reset for the second time...")
|
|
(SETQ MESS4 "Now do-test will determine if correct results have been produced...")
|
|
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>EXEC>TEST.REPORT")
|
|
(DEFUN R-FORMAT (STATUS)
|
|
(FORMAT *OUTPUT* "~%COMMAND: NAME ~%STATUS: ~A DATE: ~A TESTER: ~A~%" STATUS (IL:DATE) IL:USERNAME))
|
|
|
|
(SETQ NAME-COMMAND-STRING
|
|
"(FORMAT NIL MESS0)
|
|
DA
|
|
(SETQ TODAY-1 CL:*)
|
|
(FORMAT NIL MESS1)
|
|
NAME DATE DA
|
|
DATE
|
|
(SETQ TODAY-2 CL:*)
|
|
(FORMAT NIL MESS2)
|
|
(SETQ FOO 'FIRST-FOO)
|
|
(SETQ FOO 'SECOND-FOO)
|
|
(SETQ FOO 'THIRD-FOO)
|
|
NAME FOO-2 FOO -2
|
|
FOO-2
|
|
(SETQ NEW-FOO CL:*)
|
|
(FORMAT NIL MESS3)
|
|
(DO-TEST 'NAME-TEST-RESULT
|
|
(PROG2 (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
|
:IF-EXISTS :APPEND))
|
|
(IF (AND (STRING-EQUAL TODAY-1 TODAY-2 :END1 16 :END2 16)
|
|
(EQ NEW-FOO 'SECOND-FOO))
|
|
(PROGN (R-FORMAT 'SUCCESS) T)
|
|
(PROGN (R-FORMAT 'FAIL) NIL))
|
|
(CLOSE *OUTPUT*)
|
|
)
|
|
)
|
|
")
|
|
(IL:BKSYSBUF NAME-COMMAND-STRING)
|
|
)
|
|
)
|
|
|
|
STOP
|
|
|
|
|
|
|
|
|