1
0
mirror of synced 2026-01-15 08:22:58 +00:00

342 lines
13 KiB
Plaintext

;; Being tested: SEdit
;;
;; Source: {ERIS}<LispCore>DOC>SEDIT>SEDIT.TEDIT
;;
;; Created By: Henry Cate III
;;
;; Creation Date: February 10, 1987
;;
;; Last Update:
;;
;; Filed As: {eris}<lispcore>test>SEdit>command-eval.u
;;
;;
;;
(do-test "load the functions for the prompter for interactive tests"
(if (not (fboundp 'do-test-menu-setup))
(load "{ERINYES}<test>TOOLS>DO-TEST-MENU.dfasl"))
T)
(do-test-group "Evaluate"
:before (progn
(setq window-list (do-test-menu-Setup "Evaluate")))
:after (progn
(do-test-menu-Cleanup window-list))
(do-test "Evaluate: no selection/no caret"
(let* ((user-result (do-test-menu-Message window-list 'high
" Testing Evaluate
If needed, bring up a second exec and type: \"(cl:in-package 'xcl-test)\"
Then in the exec type:
(setq tempx '(1 4.5 6/7 a cd \"hello\" (\"hi\" b)))
(setq a 5)
(setq cd \"hi\")
(il:dv tempx)
Select Eval from the popup menu.
Does it display:
\"Select a single structure to evaluate\"? "))
(good-value (equal '(1 4.5 6/7 a cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: no selection/edit caret"
(do-test-menu-Message window-list 'low
" Testing: no selection/edit caret
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" (\"hi\" b))
Want to place the edit caret right after the 1 without selecting it. Do this by pressing the left mouse button with the mouse cursor just to the right of the 1.
If a break window pops up in the rests of these tests, just up arrow out of it and try again.
Type meta-E.
Does it display:
\"Select a single structure to evaluate\"?"))
(do-test "Evaluate: no selection/structure caret"
(do-test-menu-Message window-list 'low
" Testing: no selection/structure caret
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" (\"hi\" b))
Want to place the structure caret right between \"a\" and \"cd\" without selecting either item. Do this by positioning the mouse cursor between the two items and press the middle button.
Type meta-E.
Does it display:
\"Select a single structure to evaluate\"?"))
(do-test "Evaluate: select a litatom"
(do-test-menu-Message window-list 'low
" Testing: select a litatom
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" (\"hi\" b))
Select the litatom \"cd\" as a structure, by pressing the middle button with the cursor over the litatom.
Type meta-E.
Is the result a string \"hi\"? "))
(do-test "Evaluate: select a string"
(do-test-menu-Message window-list 'low
" Testing: select a string
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" (\"hi\" b))
Select the string \"hello\" as a structure, by pressing the middle button, with the cursor over the string.
Type meta-E.
Is the result a string \"hello\"? "))
(do-test "Evaluate: select a number"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: select a number
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" (\"hi\" b))
Select the number \"1\" as a structure, by pressing the middle button, with the cursor over the number.
Type meta-E.
Is the result the number 1?
(if a break window pops up, uparrow out of it and indicate to the test prompter failure.)"))
(good-value (equal '(1 4.5 6/7 a cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: select a list"
(do-test-menu-Message window-list 'low
" Testing: select a list
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" (\"hi\" b))
Put the edit caret after the number 6/7.
Type in \"(+ 4 5)\"
Type control-x.
Select the whole expression just entered.
Type meta-E.
Is the result the number 9?"))
(do-test "Evaluate: select a comment"
(do-test-menu-Message window-list 'low
" Testing: select a comment
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 (+ 4 5) a cd \"hello\" (\"hi\" b))
Place the edit caret after the number 1 and type \"; hello\", then select this as a structure.
Type meta-E.
Is the result \"il:\\;\"? "))
(do-test "Evaluate: select part of a litatom"
(do-test-menu-Message window-list 'low
" Testing: select part of a litatom
Assumping SEdit is editing the variable tempx which currently equals:
(1 ; hello 4.5 6/7 (+ 4 5) a cd \"hello\" (\"hi\" b))
Select the comment as a structure and press the delete key.
Select the \"d\" in the litatom \"cd\".
Type meta-E.
Does it display:
\"Select a single structure to evaluate\"? "))
(do-test "Evaluate: select part of a string"
(do-test-menu-Message window-list 'low
" Testing: select part of a string
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 (+ 4 5) a cd \"hello\" (\"hi\" b))
Select the \"h\" in the string \"hello\".
Type meta-E.
Does it display:
\"Select a single structure to evaluate\"? "))
(do-test "Evaluate: select part of a number"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: select part of a number
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 (+ 4 5) a cd \"hello\" (\"hi\" b))
Select the \"7\" in the number \"6/7\".
Type meta-E.
Does it display:
\"Select a single structure to evaluate\"?
(if a break window pops up, uparrow out of it and indicate to the test prompter failure.)"))
(good-value (equal '(1 4.5 6/7 (+ 4 5) a cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: delete a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a litatom
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 (+ 4 5) a cd \"hello\" (\"hi\" b))
Place the edit caret after the litatom \"a\".
Type control-W, meta-E.
Does it display:
\Select a single structure to evaluate\"?"))
(good-value (equal '(1 4.5 6/7 (+ 4 5) cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: delete a string"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a string
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 (+ 4 5) cd \"hello\" (\"hi\" b))
Place the structure caret after the string \"hello\".
Type control-W, meta-E.
Does it display:
\Select a single structure to evaluate\"?"))
(good-value (equal '(1 4.5 6/7 (+ 4 5) cd ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: delete a number"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a number
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 (+ 4 5) cd (\"hi\" b))
Place the edit caret right after the number \"4.5\" with no selection.
Type control-W, meta-E.
Does it display:
\Select a single structure to evaluate\"?"))
(good-value (equal '(1 6/7 (+ 4 5) cd ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: delete a list"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a list
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd (\"hi\" b))
Pick the list \"(\"hi\" b)\" as a structure and press the delete key.
Type meta-E.
Does it display:
\Select a single structure to evaluate\"?"))
(good-value (equal '(1 6/7 (+ 4 5) cd) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: delete a comment"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a comment
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd)
Place the structure caret after the litatom \"cd\" and type \"; hello\", then select this as a structure with the caret to the right.
Press the delete key, and type meta-E.
Does it display:
\Select a single structure to evaluate\"?"))
(good-value (equal '(1 6/7 (+ 4 5) cd) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
;;; When AR 7642 gets resolved may have to fix up the next several tests.
(do-test "Evaluate: extended selection of litatoms"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try extended selection of litatoms
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd)
Place the edit caret after the litatom \"cd\".
Type \" ef gh\".
Now select the litatom \"cd\" as a structure, and extend the selection to include the next two litatoms.
Type meta-m, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"? "))
(good-value (equal '(1 6/7 (+ 4 5) cd ef gh) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Evaluate: extended selection of strings"
(do-test-menu-Message window-list 'low
" Testing: extended selection of strings
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd ef gh)
Place the edit caret after the litatom \"gh\".
Type \"(hi) (bye) \"string\" \"string2\" (list)\".
Now select the first string as a structure, and extend the selection to include the second string.
In the attach menu, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"? "))
(do-test "Evaluate: extended selection of numbers"
(do-test-menu-Message window-list 'low
" Testing: extended selection of numbers
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the number \"1\" as a structure, and extend the selection to include the next number.
In the attach menu, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"? "))
(do-test "Evaluate: extended selection of lists"
(do-test-menu-Message window-list 'low
" Testing: extended selection of lists
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the list \"(hi)\" as a structure, and extend the selection to include the next list.
In the attach menu, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"?"))
(do-test "Evaluate: extended selection of litatoms and numbers"
(do-test-menu-Message window-list 'low
" Testing: extended selection of litatoms and numbers
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the number \"1\" as a structure, and extend the selection to include the next six items.
In the attach menu, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"?"))
(do-test "Evaluate: extended selection of strings and lists"
(do-test-menu-Message window-list 'low
" Testing: extended selection of strings and lists
Assumping SEdit is editing the variable tempx which currently equals:
(1 6/7 (+ 4 5) cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the litatom \"hi\" as a structure, and extend the selection to include the next four items.
In the attach menu, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"?"))
(do-test "Evaluate: extended selection of several things"
(do-test-menu-Message window-list 'low
" Testing: extended selection of several things
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the number \"1\" as a structure, and extend the selection to include the rest.
In the attach menu, left button the Eval item on the menu.
Does it display:
\Select a single structure to evaluate\"?"))
(do-test "Evaluate: selection of entire structure"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: selection of entire structure
Assumping SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the number \"1\" as a structure, and extend the selection to include the rest, press the delete key.
Type: \"* 45 55\"
Select the entire structure.
In the attach menu, left button the Eval item on the menu.
Is the result shown to be 2475?"))
(good-value (equal '(* 45 55) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
) ; end of do-test-group
STOP