1
0
mirror of synced 2026-01-31 06:02:25 +00:00
Files
Interlisp.medley/internal/test/env/code-editor/hand/Command-paren.u.~1~

338 lines
15 KiB
Plaintext

;; Being tested: SEdit
;;
;; Source: {ERIS}<LispCore>DOC>SEDIT>SEDIT.TEDIT
;;
;; Created By: Henry Cate III
;;
;; Creation Date: February 5, 1987
;;
;; Last Update:
;;
;; Filed As: {eris}<lispcore>test>SEdit>SEdit-command-low-paren.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 "Parenthesize current selection"
:before (progn
(setq window-list (do-test-menu-Setup "Parenthesize")))
:after (progn
(do-test-menu-Cleanup window-list))
(do-test "Parenthesize: 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 23 ab cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4)))
(il:dv tempx)
Type meta-(.
Were you able to get this far?"))
(good-value (equal '(1 23 ab cd "how" "are" "you" ("hi" "bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: no selection/edit caret"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (1 23 ab cd \"how\" \"are\" \"you\" (\"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 meta-(.
Were you able to get this far?"))
(good-value (equal '(1 23 ab cd "how" "are" "you" ("hi" "bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: no selection/structure caret"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (1 23 ab cd \"how\" \"are\" \"you\" (\"hi\" \"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 meta-(.
Were you able to get this far?"))
(good-value (equal '(1 23 ab cd "how" "are" "you" ("hi" "bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (1 23 ab cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
Testing: select a litatom
Select the litatom \"ab\" as a structure, by pressing the middle button with the cursor over the litatom.
Type meta-).
Were you able to get this far?"))
(good-value (equal '(1 23 (ab) cd "how" "are" "you" ("hi" "bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select a string"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (1 23 (ab) cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
Testing: select a string
Select the string \"how\" as a structure, by pressing the middle button, with the cursor over the string.
Type meta-).
Were you able to get this far?"))
(good-value (equal '(1 23 (ab) cd ("how") "are" "you" ("hi" "bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select a number"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals (1 23 (ab) cd (\"how\") \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
Testing: select a number
Select the number \"1\" as a structure, by pressing the middle button, with the cursor over the number.
Select PAREN from the popup menu.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" ("hi" "bye" a 23 4)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select a list"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
Testing: select a list
Select the list (\"hi\" \"bye\" a 23 4) as a structure.
Type meta-9, and then control-x.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select a comment"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: select a comment
Place the edit caret after the number 23 and type \"; hello\", then select this as a structure, and type meta-0.
Check to see if it has parenthesis around it, then select Abort from the pop-up menu.
Was the parenthesis around the comment?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select part of a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: select part of a litatom
Type: \"(il:dv tempx)\"
Select the \"d\" in the litatom \"cd\" and type meta-0.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select part of a string"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: select part of a string
Select the \"h\" in the string \"how\" and type meta-0.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: select part of a number"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: select part of a number
Select the \"2\" in the number \"23\" and type meta-0.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: delete a litatom"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: try after deleting a litatom
Place the edit caret after the litatom \"ab\" with in the list.
Type \" ef\", then control-W and meta-0.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: delete a string"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: try after deleting a string
Place the structure caret after the string \"hi\" with in the list.
Type a double quote, and then the word \"there\", put the structure caret right after this string, and type control-W and meta-0.
Were you able to get this far?"))
(good-value (equal '((1) 23 (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: delete a number"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: try after deleting a number
Place the edit caret right after the number \"23\" with no selection.
Type control-W, and meta-(, control-x.
Were you able to get this far?"))
(good-value (equal '((1) (ab) cd ("how") "are" "you" (("hi" "bye" a 23 4))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: delete a list"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
Testing: try after deleting a number
Place the structure caret right after the list \"((\"hi\" \"bye\" a 23 4))\" with no selection.
Type control-W, and meta-(, control-x.
Were you able to get this far?"))
(good-value (equal '((1) (ab) cd ("how") "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: delete a comment"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (ab) cd (\"how\") \"are\" \"you\")
Testing: try after deleting a comment
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-(, control-x.
Were you able to get this far?"))
(good-value (equal '((1) (ab) cd ("how") "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of litatoms"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (ab) cd (\"how\") \"are\" \"you\")
Testing: try extended selection of litatoms
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-(.
Were you able to get this far?"))
(good-value (equal '((1) (ab) (cd ef gh) ("how") "are" "you") tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of strings"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (ab) (cd ef gh) (\"how\") \"are\" \"you\")
Testing: extended selection of strings
Select the string \"are\" as a structure, and extend the selection to include the next string.
Type meta-(.
Were you able to get this far?"))
(good-value (equal '((1) (ab) (cd ef gh) ("how") ("are" "you")) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of numbers"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (ab) (cd ef gh) (\"how\") (\"are\" \"you\"))
Testing: extended selection of numbers
Place the structure caret after the list \"(1)\".
Type \" 2 3 4\".
Now select the number \"2\" as a structure, and extend the selection to include the next two numbers.
Type meta-).
Were you able to get this far?"))
(good-value (equal '((1) (2 3 4) (ab) (cd ef gh) ("how") ("are" "you")) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of lists"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (2 3 4) (ab) (cd ef gh) (\"how\") (\"are\" \"you\"))
Testing: extended selection of lists
Select the list \"(2 3 4)\" as a structure, and extend the selection to include the next two lists.
Type meta-).
Were you able to get this far?"))
(good-value (equal '((1) ((2 3 4) (ab) (cd ef gh)) ("how") ("are" "you")) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of litatoms and numbers"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) ((2 3 4) (ab) (cd ef gh)) (\"how\") (\"are\" \"you\"))
Testing: extended selection of litatoms and numbers
Select the list \"((2 3 4) (ab) (cd ef gh))\" as a structure and press the delete key.
Now type \" ab 23 cd 45\"
Select the litatom \"ab\" as a structure, and extend the selection to include the next three items.
Type meta-).
Were you able to get this far?"))
(good-value (equal '((1) (ab 23 cd 45) ("how") ("are" "you")) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of strings and lists"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (ab 23 cd 45) (\"how\") (\"are\" \"you\"))
Testing: extended selection of strings and lists
Place the structure caret after the list \"(1)\".
Type \" (hi) \"hi\" (bye) \"bye\" (list-string)\"
Select the list \"(hi)\" as a structure, and extend the selection to include the next four items.
Select Paren from the popup menu.
Were you able to get this far?"))
(good-value (equal '((1) ((hi) "hi" (bye) "bye" (list-string)) (ab 23 cd 45) ("how") ("are" "you")) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: extended selection of several things"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) ((hi) \"hi\" (bye) \"bye\" (list-string)) (ab 23 cd 45) (\"how\") (\"are\" \"you\"))
Testing: extended selection of several things
Select the second list as a structure, extend the select to include the rest of the items, and press the delete key.
Type \"23 a-litatom 45 \"hi\" bye (my small list)\"
Select the number \"23\" as a structure, and extend the selection to include the next six items.
Select Paren from the popup menu.
Were you able to get this far?"))
(good-value (equal '((1) (23 a-litatom 45 "hi" bye (my small list))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Parenthesize: selection of entire structure"
(let* ((user-result (do-test-menu-Message window-list 'low
"Assumping SEdit is editing tempx which currently equals ((1) (23 a-litatom 45 \"hi\" bye (my small list)))
Testing: selection of entire structure
Select the entire structure.
Select Paren from the popup menu.
Were you able to get this far?"))
(good-value (equal '(((1) (23 a-litatom 45 "hi" bye (my small list)))) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
) ; end of do-test-group
STOP