252 lines
8.8 KiB
Plaintext
252 lines
8.8 KiB
Plaintext
;; Being tested: ReadNumber
|
|
;;
|
|
;; Source:
|
|
;;
|
|
;; Created By: Henry Cate III
|
|
;;
|
|
;; Creation Date: March 10, 1987
|
|
;;
|
|
;; Last Update:
|
|
;;
|
|
;; Filed As: {eris}<lispcore>test>Keyboard>ReadNumber.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 "Testing ReadNumber"
|
|
:before (progn
|
|
(setq window-list (do-test-menu-Setup "ReadNumber")))
|
|
|
|
:after (progn
|
|
(do-test-menu-Cleanup window-list))
|
|
|
|
(do-test "Check basic ReadNumber works"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Get to the Interlisp exec
|
|
If there is no free Interlisp exec, bring up a another one.
|
|
Place the cursor in the Interlisp exec.
|
|
Indicate success when you get this far. "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(SIMPLE TEST, TYPE 1234)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Check basic ReadNumber works
|
|
Enter the number \"1234\" by clicking each item on the menu, then on \"ok\"
|
|
Does \"ReadNumber\" have the message:
|
|
\"Simple Test, Type 1234\"? "))
|
|
(good-value (equal 1234 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Try rest of the numbers and minus sign"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type the number -56789)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test a little more of ReadNumber
|
|
Enter the number \"-56789\" by clicking the numbers first, and then the minus sign, from the menu, then on \"ok\"
|
|
Were you able to get this far? "))
|
|
(good-value (equal -56789 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test clear"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type the number 123, then clr, then 567)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test a little more of ReadNumber
|
|
Enter the number \"123\" by clicking each number first
|
|
then click on the clr item
|
|
then enter \"567\" by clicking on each number
|
|
then on \"ok\"
|
|
Were you able to get this far? "))
|
|
(good-value (equal 567 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test back space and position"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type the number 482, bs twice, then 15) '(0 . 0)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test back space and position
|
|
Enter the number \"482\" by clicking each number first
|
|
then click on the bs item twice
|
|
then enter \"15\" by clicking on each number
|
|
then on \"ok\"
|
|
Did the menu appear in the bottom left hand corner? "))
|
|
(good-value (equal 415 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test abort"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type number 123 then abort) NIL NIL NIL T))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test abort
|
|
Enter the number \"123\" by clicking each number first
|
|
then on \"abort\"
|
|
Were you able to get this far? "))
|
|
(good-value (equal nil il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test decimal"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type number 123.456) NIL NIL NIL NIL T))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test decimal
|
|
Enter the number \"123.456\" by clicking each number first
|
|
then on \"ok\"
|
|
Were you able to get this far? "))
|
|
(good-value (equal 123.456 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test decimal & abort"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type number 90.87) NIL NIL NIL T T))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test decimal and abort
|
|
Enter the number \"90.87\" by clicking each number first
|
|
then on \"ok\"
|
|
Were both the decimal point and the abort key in the menu? "))
|
|
(good-value (equal 90.87 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test message font"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type number 123) NIL '(MODERN 18)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test message font
|
|
This may take a minute to find the right font
|
|
Enter the number \"123\" by clicking each number first
|
|
then on \"ok\"
|
|
Was the font for the message very big? "))
|
|
(good-value (equal 123 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test number font"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in in Interlisp exec
|
|
Indicate success when the cursor is in the Interlisp exec "))
|
|
(command-string
|
|
"(SETQ TEMPX (RNUMBER '(Type number 123) NIL NIL '(MODERN 18)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test number font
|
|
This may take a minute to find the right font
|
|
Enter the number \"123\" by clicking each number first
|
|
then on \"ok\"
|
|
Was the font for the numbers very big? "))
|
|
(good-value (equal 123 il:|TEMPX|)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
|
|
(do-test "Test can call from XCL"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in an XCL exec
|
|
If needed bring up another XCL exec.
|
|
Indicate success when the cursor is in the XCL exec "))
|
|
(command-string
|
|
"(cl:in-package 'xcl-test)
|
|
(setq tempx (il:rnumber '(Type number 123)))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test number font
|
|
This may take a minute to find the right font
|
|
Enter the number \"123\" by clicking each number first
|
|
then on \"ok\"
|
|
Was the font for the numbers very big? "))
|
|
(good-value (equal 123 TEMPX)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test create.numberpad.reader"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in an XCL exec
|
|
Indicate success when the cursor is in the XCL exec "))
|
|
(command-string
|
|
"(setq temp-numberpad (il:create.numberpad.reader '(Continous input)))
|
|
(setq tempx (il:numberpad.read temp-numberpad))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test create.numberpad.reader
|
|
Enter the number \"123\" by clicking each number first
|
|
then on \"ok\"
|
|
Was the font for the numbers very big? "))
|
|
(good-value (equal 123 TEMPX)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
(do-test "Test create.numberpad.reader"
|
|
(let* ((user-result1 (do-test-menu-Message window-list 'high
|
|
" Make sure cursor in an XCL exec
|
|
Indicate success when the cursor is in the XCL exec "))
|
|
(command-string
|
|
"(setq tempx (il:numberpad.read temp-numberpad))")
|
|
(toss-away (IL:BKSYSBUF command-string))
|
|
(user-result2 (do-test-menu-Message window-list 'high
|
|
" Test create.numberpad.reader
|
|
Enter the number \"456\" by clicking each number first
|
|
then on \"ok\"
|
|
Was the font for the numbers very big? "))
|
|
(good-value (equal 456 TEMPX)))
|
|
(and user-result1 user-result2 (if (eq t user-result2) good-value T))
|
|
))
|
|
|
|
|
|
) ; end of do-test-group
|
|
|
|
|
|
STOP
|
|
|
|
|