File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 192192 (equal t
193193 (numberp (parse-integer (format nil " ~d " (expt 10 65 ))))))
194194
195- ; ;; test ASH
196- ; ;; important note:
197- ; ;; at clhs example (ash -100000000000000000000000000000000 -100) => -79
198- ; ;; but js op: -100000000000000000000000000000000 >> -100 => 0
199- ; ;;
195+ ; ;; test ASH
200196(test
201- (let ((pattern ' (32 16 8 0 ))
197+ (let ((pattern ' (32 16 8 ))
202198 (result (mapcar (lambda (x y) (ash x y))
203- ' (16 16 16 -100000000000000000000000000000000 )
204- ' (1 0 -1 -100 ))))
199+ ' (16 16 16 )
200+ ' (1 0 -1 ))))
205201 (equal pattern result)))
206202
203+ ; ;; JSCL-specific: JS bitwise shift gives 0 for this bignum case
204+ ; ;; CLHS says (ash -100000000000000000000000000000000 -100) => -79
205+ #+ jscl
206+ (test (= 0 (ash -100000000000000000000000000000000 -100 )))
207+
207208; ;;(equal '(32 16 8 0)
208209; ;; (mapcar (lambda (x y) (ash x y))
209210; ;; '(16 16 16 -100000000000000000000000000000000)
215216 (ash #xFFFF 2 ))))
216217
217218; ;; test LOG
218- (test
219- (equal 0 (log 1 )))
220- (test
221- (equal 2 (log 100 10 )))
222- (test
223- (equal 3 (log 8.0 2 )))
219+ (test (zerop (log 1 )))
220+ (test (< (abs (- 2 (log 100 10 ))) 1e-10 ))
221+ (test (< (abs (- 3 (log 8.0 2 ))) 1e-10 ))
224222
225223; ;; test LOGNOT
226224(test
Original file line number Diff line number Diff line change 3030 (cons (find-class ' atomic-test-class) ' standard-class)
3131 (cons (let nil (lambda nil nil )) ' function)))
3232
33+ ; ;; JSCL-specific: tests JSCL's type-of results for +atomic-test-objects+
34+ #+ jscl
3335(test
3436 (mv-eql
3537 (let ((real-type-of)
3638 (idx 0 )
39+ (diff0)
3740 (diff1)
3841 (diff2)
3942 (expected-type-of
441444 (typep #\space ' standard-char))
442445 t t t ))
443446
444- ; ;; type-of
447+ ; ;; type-of (JSCL-specific expected values)
448+ #+ jscl
445449(test
446450 (let* ((universum (list 1 ' symbol 1.2 # () (make-array ' (1 1 )) " string" (list ) (list 0 ) t nil )))
447451 (every #' identity
You can’t perform that action at this time.
0 commit comments