1
0
mirror of synced 2026-01-15 00:12:24 +00:00

315 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-base.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 "Base"
:before (progn
(setq window-list (do-test-menu-Setup "Base")))
:after (progn
(do-test-menu-Cleanup window-list))
(do-test "Base: no selection/no caret"
(let* ((user-result (do-test-menu-Message window-list 'high
" Testing Base
If needed, bring up a second exec and type: \"(cl:in-package 'xcl-test)\"
Then in the exec type:
(setq tempx '(1 23 4.5 6/7 a cd \"hello\" (\"hi\" b)))
(il:dv tempx)
Select BASE from the popup menu. Enter 9 as the base.
Do the numbers read: \"#9r1 #9r25 4.5 #9r6/7\"? "))
(good-value (equal '(1 23 4.5 6/7 a cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 9
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-B, and enter 8 as the base, and then control-x.
Do the numbers read: \"#o1 #o27 4.5 #o6/7\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 8
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-B, and enter 7 as the base.
Do the numbers read: \"#7r1 #7r32 4.5 #7r6/10\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 7
Select the litatom \"cd\" as a structure, by pressing the middle button with the cursor over the litatom.
Type meta-B, and enter 6 as the base.
Do the numbers read: \"#6r1 #6r35 4.5 #6r10/11\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 6
Select the string \"hello\" as a structure, by pressing the middle button, with the cursor over the string.
Type meta-B, and enter 5 as the base.
Do the numbers read: \"#5r1 #5r43 4.5 #5r11/12\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 5
Select the number \"1\" as a structure, by pressing the middle button, with the cursor over the number.
Select SET PRINT-BASE from the popup menu, and enter 4 as the base.
Do the numbers read: \"#4r1 #4r113 4.5 #4r12/13\"? "))
(good-value (equal '(1 23 4.5 6/7 a cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 4
Select the list (\"hi\" b) as a structure.
Select SET PRINT-BASE from the popup menu, and enter 3 as the base.
Type control-x.
Do the numbers read: \"#3r1 #3r212 4.5 #3r20/21\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 3
Place the edit caret after the number 23 and type \"; hello\", then select this as a structure.
Type meta-B, and enter 2 as the base.
Do the numbers read: \"#b1 #b10111 4.5 #b110/111\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 2
Type meta-A, and click yes.
Now in the exec type: \"(il:dv tempx)\"
Select the \"d\" in the litatom \"cd\".
Type meta-B, and enter 11 as the base.
Do the numbers read: \"#11r1 #11r21 4.5 #11r6/7\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 11
Select the \"h\" in the string \"hello\".
Type meta-B, and enter 10 as the base.
Do the numbers read: \"1 23 4.5 6/7\"? "))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b))
Select the \"7\" in the number \"6/7\".
Type meta-B, and enter 12 as the base.
Do the numbers read: \"#12r1 #12r1B 4.5 #12r6/7\"?"))
(good-value (equal '(1 23 4.5 6/7 a cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 23 4.5 6/7 a cd \"hello\" (\"hi\" b)) with a print base of 12
Place the edit caret after the litatom \"a\".
Type control-W, meta-B, and enter 13 as the base.
Do the numbers read: \"#13r1 #13r1A 4.5 #13r6/7\"?"))
(good-value (equal '(1 23 4.5 6/7 cd "hello" ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 23 4.5 6/7 cd \"hello\" (\"hi\" b)) with a print base of 13
Place the structure caret after the string \"hello\".
Type control-W, meta-B, and enter 14 as the base
Do the numbers read: \"#14r1 #14r19 4.5 #14r6/7\"? "))
(good-value (equal '(1 23 4.5 6/7 cd ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 23 4.5 6/7 cd (\"hi\" b)) with a print base of 14
Place the edit caret right after the number \"23\" with no selection.
Type control-W, meta-B, and enter 15 as the base
Do the numbers read: \"#15r1 4.5 #15r6/7\"? "))
(good-value (equal '(1 4.5 6/7 cd ("hi" b)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 4.5 6/7 cd) with a print base of 15
Pick the list \"(\"hi\" b)\" as a structure and press the delete key.
Type meta-B, and enter 16 as the base.
Do the numbers read: \"#x1 4.5 #x6/7\"? "))
(good-value (equal '(1 4.5 6/7 cd) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 4.5 6/7 cd) with a print base of 16
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-B, and enter 17 as the base.
Do the numbers read: \"#17r1 4.5 #17r6/7\"? "))
(good-value (equal '(1 4.5 6/7 cd) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 4.5 6/7 cd) with a print base of 17
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, change the value of Print-Base to 1, and left button the Print-Base item on the menu.
Does it log complaint in the SEdit message window of \"Illegal print-base: 1\"? "))
(good-value (equal '(1 4.5 6/7 cd ef gh) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
(do-test "Base: 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 4.5 6/7 cd ef gh) with a print base of 17
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, change the value of Print-Base to 37, and left button the Print-Base item on the menu.
Does it log complaint in the SEdit message window of \"Illegal print-base: 37\"? "))
(do-test "Base: 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 4.5 6/7 cd ef gh (hi) (bye) \"string\" \"string2\" (list)) with a print base of 17
Select the number \"1\" as a structure, and extend the selection to include the next two numbers.
In the attach menu, try to change the value of Print-Base to 1000, then left button the Print-Base item on the menu.
Do the numbers read: \"1 4.5 6/7\"? "))
(do-test "Base: 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 4.5 6/7 cd ef gh (hi) (bye) \"string\" \"string2\" (list))
Select the list \"(\"hi\")\" as a structure, and extend the selection to include the next list.
From the popup menu pick SET PRINT-BASE, and enter 10.
Do the numbers read: \"1 4.5 6/7\"? "))
(do-test "Base: 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 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 next five items.
From the popup menu pick SET PRINT-BASE, and enter 10.
Do the numbers read: \"1 4.5 6/7\"? "))
(do-test "Base: 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 4.5 6/7 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.
From the popup menu pick SET PRINT-BASE, and enter 2.
Do the numbers read: \"#b1 4.5 #b110/111\"? "))
(do-test "Base: 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)) with a base of 2
Select the number \"1\" as a structure, and extend the selection to include the next 10 items.
In the attached menu change the Print-Base to 8, and key on the menu item Print-Base.
Do the numbers read: \"#o1 4.5 #o6/7\"? "))
(do-test "Base: 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)) with a base of 8
Select the entire structure.
Type meta-B and enter 16 as the base.
Do the numbers read: \"#x1 4.5 #x6/7\"? "))
(good-value (equal '(1 4.5 6/7 cd ef gh (hi) (bye) "string" "string2" (list)) tempx)))
(and user-result (if (eq t user-result) good-value T))
))
) ; end of do-test-group
STOP