343 lines
15 KiB
Plaintext
343 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-(.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: no selection/edit caret
|
|
Assuming SEdit is editing tempx which currently equals (1 23 ab cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
|
|
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-(.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: no selection/structure caret
|
|
Assuming SEdit is editing tempx which currently equals (1 23 ab cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
|
|
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-(.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: select a litatom
|
|
Assuming SEdit is editing tempx which currently equals (1 23 ab cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
|
|
Select the litatom \"ab\" as a structure, by pressing the middle button with the cursor over the litatom.
|
|
Type meta-).
|
|
Is the litatom AB now parenthesized?"))
|
|
(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
|
|
" Testing: select a string
|
|
Assuming SEdit is editing tempx which currently equals (1 23 (ab) cd \"how\" \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
|
|
Select the string \"how\" as a structure, by pressing the middle button, with the cursor over the string.
|
|
Type meta-).
|
|
Is the string \"how\" now parenthesized?"))
|
|
(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
|
|
" Testing: select a number
|
|
Assuming SEdit is editing tempx which currently equals (1 23 (ab) cd (\"how\") \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
|
|
Select the number \"1\" as a structure, by pressing the middle button, with the cursor over the number.
|
|
Select PARENTHESIZE from the popup menu.
|
|
Is the number \"1\" now parenthesized?"))
|
|
(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
|
|
" Testing: select a list
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" (\"hi\" \"bye\" a 23 4))
|
|
Select the list (\"hi\" \"bye\" a 23 4) as a structure.
|
|
Type meta-9, and then control-x.
|
|
Is the list now parenthesized?"))
|
|
(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
|
|
" Testing: select a comment
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
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, clicking the left button to confirm the abort.
|
|
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
|
|
" Testing: select part of a litatom
|
|
Assuming tempx currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
Type: \"(il:dv tempx)\"
|
|
Select the \"d\" in the litatom \"cd\" and type meta-0.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: select part of a string
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
Select the \"h\" in the string \"how\" and type meta-0.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: select part of a number
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
Select the \"2\" in the number \"23\" and type meta-0.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: try after deleting a litatom
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
Place the edit caret after the litatom \"ab\" with in the list.
|
|
Type \" ef\", then control-W and meta-0.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: try after deleting a string
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
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.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: try after deleting a number
|
|
Assuming SEdit is editing tempx which currently equals ((1) 23 (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
Place the edit caret right after the number \"23\" with no selection.
|
|
Type control-W, and meta-(, control-x.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: try after deleting a list
|
|
Assuming SEdit is editing tempx which currently equals ((1) (ab) cd (\"how\") \"are\" \"you\" ((\"hi\" \"bye\" a 23 4)))
|
|
Place the structure caret right after the list \"((\"hi\" \"bye\" a 23 4))\" with no selection.
|
|
Type control-W, and meta-(, control-x.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: try after deleting a comment
|
|
Assuming SEdit is editing tempx which currently equals ((1) (ab) cd (\"how\") \"are\" \"you\")
|
|
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.
|
|
Does the SEdit prompt window say \"Select structure to parenthesize.\"?"))
|
|
(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
|
|
" Testing: try extended selection of litatoms
|
|
Assuming SEdit is editing tempx which currently equals ((1) (ab) cd (\"how\") \"are\" \"you\")
|
|
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-(.
|
|
Are the three litatoms now parenthesized?"))
|
|
(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
|
|
" Testing: extended selection of strings
|
|
Assuming SEdit is editing tempx which currently equals ((1) (ab) (cd ef gh) (\"how\") \"are\" \"you\")
|
|
Select the string \"are\" as a structure, and extend the selection to include the next string.
|
|
Type meta-(.
|
|
Are the two strings now parenthesized?"))
|
|
(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
|
|
" Testing: extended selection of numbers
|
|
Assuming SEdit is editing tempx which currently equals ((1) (ab) (cd ef gh) (\"how\") (\"are\" \"you\"))
|
|
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-).
|
|
Are the three numbers now parenthesized?"))
|
|
(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
|
|
" Testing: extended selection of lists
|
|
Assuming SEdit is editing tempx which currently equals ((1) (2 3 4) (ab) (cd ef gh) (\"how\") (\"are\" \"you\"))
|
|
Select the list \"(2 3 4)\" as a structure, and extend the selection to include the next two lists.
|
|
Type meta-).
|
|
Are the three lists now parenthesized?"))
|
|
(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
|
|
" Testing: extended selection of litatoms and numbers
|
|
Assuming SEdit is editing tempx which currently equals ((1) ((2 3 4) (ab) (cd ef gh)) (\"how\") (\"are\" \"you\"))
|
|
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-).
|
|
Is the selection now parenthesized?"))
|
|
(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
|
|
" Testing: extended selection of strings and lists
|
|
Assuming SEdit is editing tempx which currently equals ((1) (ab 23 cd 45) (\"how\") (\"are\" \"you\"))
|
|
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 Parenthesize from the popup menu.
|
|
Is the selection now parenthesized?"))
|
|
(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
|
|
" Testing: extended selection of several things
|
|
Assuming SEdit is editing tempx which currently equals ((1) ((hi) \"hi\" (bye) \"bye\" (list-string)) (ab 23 cd 45) (\"how\") (\"are\" \"you\"))
|
|
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 five items.
|
|
Select Parenthesize from the popup menu.
|
|
Is the selection now parenthesized?"))
|
|
(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
|
|
"Assuming 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 Parenthesize from the popup menu.
|
|
Is the entire structure inside an extra set of parentheses?"))
|
|
(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: clean-up"
|
|
(let* ((user-result (do-test-menu-Message window-list 'low
|
|
"Close the SEdit window.")))
|
|
))
|
|
|
|
|
|
) ; end of do-test-group
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
STOP
|