1
0
mirror of synced 2026-01-17 00:52:40 +00:00

325 lines
14 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-find.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 "Find"
:before (progn
(setq window-list (do-test-menu-Setup "Find")))
:after (progn
(do-test-menu-Cleanup window-list))
(do-test "Find: no selection/no caret"
(let* ((user-result (do-test-menu-Message window-list 'high
" Testing Find
If there is no free Xerox Common Lisp exec, bring up a another one and type: \"(cl:in-package 'xcl-test)\"
In the exec type:
(setq tempx '(1 4.5 6/7 a cd \"hello\" \"BYE\" (\"hi\" b cd 4)))
(il:dv tempx)
Select Find from the popup menu. Type in \"cd\".
Does it find the litatom \"cd\" and select it? "))
(good-value (equal '(1 4.5 6/7 a cd "hello" "BYE" ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: no selection/edit caret"
(do-test-menu-Message window-list 'low
" Testing: no selection/edit caret
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" (\"hi\" b cd 4))
Type control-x.
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.
Type meta-F. Type in \"6/7\".
Does it find the number \"6/7\" and select it? "))
(do-test "Find: no selection/structure caret"
(do-test-menu-Message window-list 'low
" Testing: no selection/structure caret
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" (\"hi\" b cd 4))
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 pressing the middle button.
Type meta-F. Enter the string \"hello\".
Does it find the string \"hello\" and select it? "))
(do-test "Find: select a litatom"
(do-test-menu-Message window-list 'low
" Testing: select a litatom
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" (\"hi\" b cd 4))
Select the first litatom \"cd\" as a structure, by pressing the middle button with the cursor over the litatom.
Press the find key.
Does it find the second occurance of the litatom and select it? "))
(do-test "Find: select a string"
(do-test-menu-Message window-list 'low
" Testing: select a string
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" (\"hi\" b cd 4))
Select the string \"hello\" as a structure, by pressing the middle button, with the cursor over the string.
Type meta-F.
Does it display a message of \"\"hello\" - Not found.\"? "))
(do-test "Find: select a number"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: select a number
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" (\"hi\" b cd 4))
Place the structure caret right after the string \"BYE\".
Type \" 4.5 (bye) (bye)\", and then control-x
Select the first number \"4.5\" as a structure, by pressing the middle button, with the cursor over the number.
Type meta-F.
Does it find the second occurance of the number and select it?"))
(good-value (equal '(1 4.5 6/7 a cd "hello" "BYE" 4.5 (bye) (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: select a list"
(do-test-menu-Message window-list 'low
" Testing: select a list
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Select the first list \"(bye)\" as a structure, by pressing the middle button, with the cursor over one of the parentheses.
Type meta-F.
Does it find the second occurance of the list and select it?"))
(do-test "Find: select a comment"
(do-test-menu-Message window-list 'low
" Testing: select a comment
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Place the edit caret after the number 1 and type \"; hello\", then select this as a structure.
Type meta-F.
Does it display a message of \"(il:* il:\\; \" hello\") - Not found.\"? "))
(do-test "Find: select part of a litatom"
(do-test-menu-Message window-list 'low
" Testing: select part of a litatom
Assuming SEdit is editing the variable tempx which currently equals:
(1 ; hello 4.5 6/7 a cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Select the comment as a structure and press the delete key.
Type control-x.
Select the \"d\" in the first litatom \"cd\".
Type meta-F. Enter the litatom \"bye\"
(If it doesn't ask what to find indicate failure to the prompter.)
Does it find the first litatom \"bye\" and underline only it?"))
(do-test "Find: select part of a string"
(do-test-menu-Message window-list 'low
" Testing: select part of a string
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Select the \"h\" in the string \"hello\".
Type meta-F. Enter the number \"4\"
(If it doesn't ask what to find indicate failure to the prompter.)
Does it find the number \"4\" and underline only it?"))
(do-test "Find: select part of a number"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: select part of a number
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Select the \"7\" in the number \"6/7\".
Type meta-F. Enter the list \"(\"hi\" b cd 4)\"
(If it doesn't ask what to find indicate failure to the prompter.)
Does it find the list \"(\"hi\" b cd 4)\" and underline only it?"))
(good-value (equal '(1 4.5 6/7 a cd "hello" "BYE" 4.5 (bye) (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: delete a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a litatom
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 a cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Place the edit caret after the litatom \"a\".
Type control-W, meta-F. Enter the number \"4.5\".
Does it find the second \"4.5\"? "))
(good-value (equal '(1 4.5 6/7 cd "hello" "BYE" 4.5 (bye) (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: delete a string"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a string
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 cd \"hello\" \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Place the structure caret after the string \"hello\".
Type control-W, meta-F. Enter the litatom \"bye\".
Does it find the first litatom \"bye\" (and not the string)? "))
(good-value (equal '(1 4.5 6/7 cd "BYE" 4.5 (bye) (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: delete a number"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a number
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 6/7 cd \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Place the edit caret right after the number \"6/7\" with no selection.
Type control-W, meta-F. Just press the carriage return.
Does it find the first litatom \"bye\" (and not the string)? "))
(good-value (equal '(1 4.5 cd "BYE" 4.5 (bye) (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: delete a list"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a list
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
Pick the first list of \"(bye)\" as a structure and press the delete key.
Type meta-F. And press the carriage return.
Does it find the litatom \"bye\"? "))
(good-value (equal '(1 4.5 cd "BYE" 4.5 (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: delete a comment"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try after deleting a comment
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd \"BYE\" 4.5 (bye) (bye) (\"hi\" b cd 4))
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, type meta-F, and press the carriage return.
Does it find the litatom \"bye\"? "))
(good-value (equal '(1 4.5 cd "BYE" 4.5 (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: extended selection of litatoms"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: try extended selection of litatoms
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Place the edit caret after the litatom \"cd\".
Type \" ef gh\", and control-x.
Now select the litatom \"cd\" as a structure, and extend the selection to include the next two litatoms.
Type meta-m, in the Find field type in the string \"BYE\", then left button the Find item on the menu.
Does it find the string \"BYE\"? "))
(good-value (equal '(1 4.5 cd ef gh "BYE" 4.5 (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: extended selection of strings"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: extended selection of strings
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
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 Find item on the menu.
Does it find the string \"BYE\"? "))
(good-value (equal '(1 4.5 cd ef gh (hi) (bye) "string" "string2" (list) "BYE" 4.5 (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Find: extended selection of numbers"
(do-test-menu-Message window-list 'low
" Testing: extended selection of numbers
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh (hi) (bye) \"string\" \"string2\" (list) \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Select the number \"1\" as a structure, and extend the selection to include the next number.
In the attach menu, left button the Find item on the menu.
Does it find the string \"BYE\"? "))
(do-test "Find: extended selection of lists"
(do-test-menu-Message window-list 'low
" Testing: extended selection of lists
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh (hi) (bye) \"string\" \"string2\" (list) \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Select the list \"(hi)\" as a structure, and extend the selection to include the next list.
In the attach menu, change the Find field to be \"4.5\", then left button the Find item on the menu.
Does it find the second number \"4.5\"? "))
(do-test "Find: extended selection of litatoms and numbers"
(do-test-menu-Message window-list 'low
" Testing: extended selection of litatoms and numbers
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh (hi) (bye) \"string\" \"string2\" (list) \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Select the number \"1\" as a structure, and extend the selection to include the next four items.
In the attach menu, left button the Find item on the menu.
Does it find the second number \"4.5\"? "))
(do-test "Find: extended selection of strings and lists"
(do-test-menu-Message window-list 'low
" Testing: extended selection of strings and lists
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh (hi) (bye) \"string\" \"string2\" (list) \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Select the litatom \"hi\" as a structure, and extend the selection to include the next four items.
In the attach menu, left button the Find item on the menu.
Does it find the second number \"4.5\"? "))
(do-test "Find: extended selection of several things"
(do-test-menu-Message window-list 'low
" Testing: extended selection of several things
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh (hi) (bye) \"string\" \"string2\" (list) \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Select the number \"1\" as a structure, and extend the selection to include the rest.
In the attach menu, left button the Find item on the menu.
Does it say \"4.5 - Not found\"? "))
(do-test "Find: selection of entire structure"
(let* ((user-result (do-test-menu-Message window-list 'low
" Testing: selection of entire structure
Assuming SEdit is editing the variable tempx which currently equals:
(1 4.5 cd ef gh (hi) (bye) \"string\" \"string2\" (list) \"BYE\" 4.5 (bye) (\"hi\" b cd 4))
Select the entire structure.
In the attach menu, left button the Find item on the menu.
Does it say \"At end; no more structure to search.\"? "))
(good-value (equal '(1 4.5 cd ef gh (hi) (bye) "string" "string2" (list) "BYE" 4.5 (bye) ("hi" b cd 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Clean up"
(do-test-menu-message window-list 'high
"Close the SEdit window by selecting Close from the window popup menu."))
) ; end of do-test-group
STOP