1
0
mirror of synced 2026-01-26 12:21:52 +00:00
Files
Interlisp.medley/internal/test/env/code-editor/hand/Control.u.~1~

363 lines
14 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;; Being tested: SEdit
;;
;; Source: {ERIS}<LispCore>DOC>SEDIT>SEDIT.TEDIT
;;
;; Created By: Henry Cate III
;;
;; Creation Date: February 6, 1987
;;
;; Last Update:
;;
;; Filed As: {eris}<lispcore>test>SEdit>command-control.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)
;;; -----------------------------------------------------
;;;
;;; The following are the complete tests, a do-test-group per command
;;; From keyboard, popup menu, attached menu. Test for all possible
;;; combinations of selection and caret point:
;;; no selection/no caret
;;; no selection/edit caret
;;; no selection/structure caret
;;; selection of each lisp type: litatom, string, list, comment, gap
;;; selection of part of each type above
;;; pending delete selection of each type above
;;; extended selection ofobjects of the same type
;;; extended selection of objects of mixed type
;;; selection of entire structure
;;; pending delete selection of entire structure
;;;
;;; -----------------------------------------------------
(do-test-group "Redisplay, test against standard set"
:before (progn
(setq window-list (do-test-menu-Setup "Redisplay")))
:after (progn
(do-test-menu-Cleanup window-list))
(do-test "Redisplay:no selection/no caret"
(do-test-menu-Message window-list 'high
"If needed, bring up a second exec and type: \"(cl:in-package 'xcl-test)\"
Testing: no selection/no caret
In the exec type:
(setq tempx '(1 xy \"hi\" (\"bye\" a 23 4)))
(il:dv tempx)
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: no selection/edit caret"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: no selection/edit caret
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 control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: no selection/structure caret"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: no selection/structure caret
Want to place the structure caret right between xy and \"hi\" without selecting either item. Do this by positioning the mouse cursor between the two items and press the middle button.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select a litatom"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select a litatom
Select the litatom \"xy\" as a structure, by pressing the middle button.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select a string"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select a string
Select the string \"hi\" as a structure.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select a number"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select a number
Select the number \"1\" as a structure.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select a list"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select a list
Select the list (\"bye\" a 23 4) as a structure.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select part of a litatom"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select part of a litatom
Select the \"x\" in the litatom \"xy\" by pressing the left button.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select part of a string"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select part of a string
Select the \"h\" in the string \"hi\".
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: select part of a number"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: select part of a number
Select the \"2\" in the number \"23\".
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: delete a litatom"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 xy \"hi\" (\"bye\" a 23 4))
Testing: delete a litatom
Delete the litatom \"xy\" by selecting it as a structure and pressing the delete key.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: delete a string"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 \"hi\" (\"bye\" a 23 4))
Testing: delete a string
Delete the string \"hi\".
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: delete of a number"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals (1 (\"bye\" a 23 4))
Testing: delete a number
Delete the number \"1\".
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: extended selection of objects of same type"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals ((\"bye\" a 23 4))
Testing: extended selection of objects of same type
Select the numbers 23 and 4, by picking the 23 with the left button, and the 4 with the right button.
Type control-L.
Was the SEdit window redisplayed?"))
(do-test "Redisplay: extended selection of objects of different types"
(do-test-menu-Message window-list 'low
"Assumping tempx currently equals ((\"bye\" a 23 4))
Testing: extended selection of objects of different types
Select all items in the smaller list.
Type control-L.
Was the SEdit window redisplayed?"))
) ; End of do-test-group
(do-test-group "Delete previous and done, test against standard set"
:before (progn
(setq window-list (do-test-menu-Setup "Delete previous")))
:after (progn
(do-test-menu-Cleanup window-list))
(do-test "Delete previous & done:no selection/no caret"
(let* (( user-result (do-test-menu-Message window-list 'high
" Testing parentheses
If needed, bring up a second exec and type: \"(cl:in-package 'xcl-test)\"
Then in the exec type:
(setq tempx '(1 2 34 ab cd ef gh \"hi\" \"how\" \"are\" \"you\" (\"bye\" a 23 4)))
(il:dv tempx)
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(1 2 34 ab cd ef gh "hi" "how" "are" "you" ("bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: no selection/edit caret"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (1 2 34 ab cd ef gh \"hi\" \"how\" \"are\" \"you\" (\"bye\" a 23 4))
Testing: no selection/edit caret
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 control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(2 34 ab cd ef gh "hi" "how" "are" "you" ("bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: no selection/structure caret"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (2 34 ab cd ef gh \"hi\" \"how\" \"are\" \"you\" (\"bye\" a 23 4))
Testing: no selection/structure caret
Want to place the structure caret right between \"ab\" and \"cd\" without selecting either item. Do this by positioning the mouse cursor between the two items and press the middle button.
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(2 34 cd ef gh "hi" "how" "are" "you" ("bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (2 34 cd ef gh \"hi\" \"how\" \"are\" \"you\" (\"bye\" a 23 4))
Testing: select a litatom
Select the litatom \"gh\" as a structure, by pressing the middle button with the cursor over the \"h\". The structure caret should end up to the right of \"gh\".
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(2 34 cd ef "hi" "how" "are" "you" ("bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select a string"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (2 34 cd ef \"hi\" \"how\" \"are\" \"you\" (\"bye\" a 23 4))
Testing: select a string
Select the string \"hi\" as a structure, with the structure caret to the right of the string.
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(2 34 cd ef "how" "are" "you" ("bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select a number"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (2 34 cd ef \"how\" \"are\" \"you\" (\"bye\" a 23 4))
Testing: select a number
Select the number \"2\" as a structure, with the structure caret to the right of the number.
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(34 cd ef "how" "are" "you" ("bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select a list"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (34 cd ef \"how\" \"are\" \"you\" (\"bye\" a 23 4))
Testing: select a list
Select the list (\"bye\" a 23 4) as a structure, with the structure caret to the right of the list.
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(34 cd ef "how" "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select part of a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (34 cd ef \"hi\" \"how\" \"are\" \"you\")
Testing: select part of a litatom
ÿÿPlace the edit caret in the middle of the litatom \"cd\".ÿ
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(34 d ef "how" "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select part of a string"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (2 3 d ef \"how\" \"are\" \"you\")
Testing: select part of a string
ÿÿPlace the edit caret ÿafter the \"h\" in the string \"how\"ÿÿ.ÿ
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(34 d ef "ow" "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: select part of a number"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (34 d ef \"ow\" \"are\" \"you\")
Testing: select part of a number
ÿÿPlace the edit caret in the middle of the ÿnumberÿÿ \"ÿ34ÿÿ\".ÿ
Type control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(4 d ef "ow" "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: delete a litatom after a delete"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (4 d ef \"ow\" \"are\" \"you\")
Testing: delete a litatom after a delete
Place the structure caret after the string \"ow\" with no selection.
Type control-W, control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(4 d "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: delete a string after a delete"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (4 d \"are\" \"you\")
Testing: delete a string
Place the structure caret after the string \"you\" with selection of the string.
Type control-W, control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal '(4 d) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Delete previous & done: delete of a number after a delete"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (4 d)
Testing: delete a number after a delete
Place the edit caret after the litatom \"d\" with no selection.
Type control-W, control-W, and a control-X.
Were you able to get this far?"))
(good-value (equal nil tempx)))
(and user-result (if (eq t user-result) good-value T))
))
) ; end of do-test-group
STOP