X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-aclrepl%2Ftests.lisp;h=ac725ed4e03e78ff5ae5adc47a5246cbc25fa2f5;hb=77af6d16968262049d6dadfb5521af7a8a7c6868;hp=85d2f9e188fd6bef591a35b6f5bf22f901b20306;hpb=9cd907d4857862f1917c9341723d6f60622b052b;p=sbcl.git diff --git a/contrib/sb-aclrepl/tests.lisp b/contrib/sb-aclrepl/tests.lisp index 85d2f9e..ac725ed 100644 --- a/contrib/sb-aclrepl/tests.lisp +++ b/contrib/sb-aclrepl/tests.lisp @@ -52,6 +52,7 @@ (defparameter *complex* #c(1 2)) (defparameter *ratio* 22/7) (defparameter *double* 5.5d0) +(defparameter *bignum* 1234567890123456789) (defparameter *array* (make-array '(3 3 2) :initial-element nil)) (defparameter *vector* (make-array '(20):initial-contents '(0 1 2 3 4 5 6 7 8 9 @@ -186,6 +187,9 @@ (def-elements-tests *complex* 2 #(1 2) #((0 . "real") (1 . "imag"))) (def-elements-tests *ratio* 2 #(22 7) #((0 . "numerator") (1 . "denominator"))) +(def-elements-tests *bignum* 2 + #(2112454933 287445236) + #((0 . :HEX32) (1 . :HEX32))) (def-elements-tests *vector* 20 #(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) #(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)) @@ -311,6 +315,11 @@ 2 REALLY-LONG-STRUCT-SLOT-NAME -> a simple-string (4) \"defg\"" nil 2) +(def-display-test *bignum* +"bignum 1234567890123456789 with 2 32-bit words + 0-> #x7DE98115 + 1-> #x112210F4") + (def-display-test *vector* "a simple T vector (20) ... @@ -347,25 +356,27 @@ tail-> a cyclic list with 1 element+tail") 1-> the symbol B tail-> a cyclic list with 2 elements+tail") -#| + ;;; Inspector traversal tests -(deftest inspect.0 (istep '(":i" "*simple-struct*")) - "# +(deftest inspect.0 (progn (setq * *simple-struct*) + (istep '("*"))) + "# 0 FIRST ----------> the symbol NIL 1 SLOT-2 ---------> the symbol A-VALUE 2 REALLY-LONG-STRUCT-SLOT-NAME -> a simple-string (4) \"defg\"") -(deftest istep.0 (prog1 - (progn (do-inspect *simple-struct*) (istep '("="))) - (reset-cmd)) - "# +(deftest istep.0 (progn (setq * *simple-struct*) + (istep '("*")) + (istep '("="))) + "# 0 FIRST ----------> the symbol NIL 1 SLOT-2 ---------> the symbol A-VALUE 2 REALLY-LONG-STRUCT-SLOT-NAME -> a simple-string (4) \"defg\"") -(deftest istep.1 (prog1 - (progn (do-inspect *simple-struct*) (istep '("first"))) - (reset-cmd)) + +(deftest istep.1 (progn (setq * *simple-struct*) + (istep '("*")) + (istep '("first"))) "the symbol NIL 0 NAME -----------> a simple-string (3) \"NIL\" 1 PACKAGE --------> the COMMON-LISP package @@ -373,10 +384,11 @@ tail-> a cyclic list with 2 elements+tail") 3 FUNCTION -------> ..unbound.. 4 PLIST ----------> the symbol NIL") -(deftest istep.2 (prog1 - (progn (do-inspect *simple-struct*) (istep '("first")) - (istep '(">"))) - (reset-cmd)) + +(deftest istep.2 (progn (setq * *simple-struct*) + (istep '("*")) + (istep '("first")) + (istep '(">"))) "the symbol A-VALUE 0 NAME -----------> a simple-string (7) \"A-VALUE\" 1 PACKAGE --------> the ACLREPL-TESTS package @@ -384,10 +396,11 @@ tail-> a cyclic list with 2 elements+tail") 3 FUNCTION -------> ..unbound.. 4 PLIST ----------> the symbol NIL") -(deftest istep.3 (prog1 - (progn (do-inspect *simple-struct*) (istep '("first")) - (istep '(">")) (istep '("<"))) - (reset-cmd)) +(deftest istep.3 (progn (setq * *simple-struct*) + (istep '("*")) + (istep '("first")) + (istep '(">")) + (istep '("<"))) "the symbol NIL 0 NAME -----------> a simple-string (3) \"NIL\" 1 PACKAGE --------> the COMMON-LISP package @@ -395,44 +408,46 @@ tail-> a cyclic list with 2 elements+tail") 3 FUNCTION -------> ..unbound.. 4 PLIST ----------> the symbol NIL") -(deftest istep.4 (prog1 - (progn (do-inspect *simple-struct*) (istep '("first")) - (istep '(">")) (istep '("<")) (istep '("tree"))) - (reset-cmd)) +(deftest istep.4 (progn (setq * *simple-struct*) + (istep '("*")) + (istep '("first")) + (istep '(">")) + (istep '("<")) + (istep '("tree"))) "The current object is: the symbol NIL, which was selected by FIRST -#, which was selected by (inspect ...) +#, which was selected by (inspect *) ") -(deftest istep.5 (prog1 - (progn (do-inspect *simple-struct*) (istep '("first")) - (istep '(">")) (istep '("<")) (istep '("-"))) - (reset-cmd)) - "# +(deftest istep.5 (progn (setq * *simple-struct*) + (istep '("*")) + (istep '("first")) + (istep '(">")) + (istep '("<")) + (istep '("-"))) + "# 0 FIRST ----------> the symbol NIL 1 SLOT-2 ---------> the symbol A-VALUE 2 REALLY-LONG-STRUCT-SLOT-NAME -> a simple-string (4) \"defg\"") -(deftest istep.6 (prog1 - (progn (do-inspect *dotted-list*) (istep '("tail"))) - (reset-cmd)) +(deftest istep.6 (progn (setq * *dotted-list*) + (istep '("*")) + (istep '("tail"))) "fixnum 3") -(deftest istep.7 (prog1 - (progn (do-inspect *dotted-list*) (istep '("2"))) - (reset-cmd)) +(deftest istep.7 (progn (setq * *dotted-list*) + (istep '("*")) + (istep '("2"))) "fixnum 3") -(deftest istep.8 (prog1 (do-inspect 5.5d0) (reset-cmd)) - "double-float 5.5d0d") +(deftest istep.8 (progn (setq * 5.5d0) + (istep '("*"))) + "double-float 5.5d0") -(deftest istep.9 (prog1 (progn (do-inspect 5.5d0) (istep '("-"))) - (reset-cmd)) - "double-float 5.5d0d") +(deftest istep.9 (progn (setq * 5.5d0) + (istep '("-"))) + "Object has no parent +") -(deftest istep.10 (progn (do-inspect 5.5d0) (istep '("-")) - (istep '("q"))) - "No object is being inspected") -|#