+
+;;; PARSE-INTEGER must signal an error of type PARSE-ERROR if it is
+;;; unable to parse an integer and :JUNK-ALLOWED is NIL.
+(macrolet ((assert-parse-error (form)
+ `(multiple-value-bind (val cond)
+ (ignore-errors ,form)
+ (assert (null val))
+ (assert (typep cond 'parse-error)))))
+ (assert-parse-error (parse-integer " "))
+ (assert-parse-error (parse-integer "12 a"))
+ (assert-parse-error (parse-integer "12a"))
+ (assert-parse-error (parse-integer "a"))
+ (assert (= (parse-integer "12") 12))
+ (assert (= (parse-integer " 12 ") 12))
+ (assert (= (parse-integer " 12asdb" :junk-allowed t) 12)))
+
+;;; #A notation enforces that once one 0 dimension has been found, all
+;;; subsequent ones are also 0.
+(assert (equal (array-dimensions (read-from-string "#3A()"))
+ '(0 0 0)))
+(assert (equal (array-dimensions (read-from-string "#3A(())"))
+ '(1 0 0)))
+(assert (equal (array-dimensions (read-from-string "#3A((() ()))"))
+ '(1 2 0)))