Fix another typo in routine reading arrays
authorDaniel Llorens <lloda@sarc.name>
Tue, 2 Mar 2021 14:12:20 +0000 (15:12 +0100)
committerDaniel Llorens <lloda@sarc.name>
Tue, 2 Mar 2021 14:12:20 +0000 (15:12 +0100)
* module/ice-9/read.scm: As stated.
* test-suite/tests/arrays.test: Test a fixed case.

module/ice-9/read.scm
test-suite/tests/arrays.test

index 29175d54c8966f40076260a60433b1e32fdef2bd..a1e4e7a8fb1ce21458c921132f544531549f07e7 100644 (file)
                         (list lbnd (+ lbnd (1- len))))
                     lbnd))))
     (define (read-shape ch alt)
-      (if (memv ch '(#\@ @\:))
+      (if (memv ch '(#\@ #\:))
           (let*-values (((ch head) (read-dimension ch))
                         ((ch tail) (read-shape ch '())))
             (values ch (cons head tail)))
index e913e30a27e7b69857ea327a4ca394fad0da56ed..c8eed39d3b74b3850a31c68ea1d9b9d42399cf53 100644 (file)
 ;;; printing arrays
 ;;;
 
-(with-test-prefix/c&e "printing arrays"
+(with-test-prefix/c&e "printing and reading arrays"
   (pass-if-equal "writing 1D arrays that aren't vectors"
     "#1(b c)"
     (format #f "~a" (make-shared-array #(a b c)
   (pass-if-equal "empty 3-array with last nonempty dim."
       "#3:0:0:1()"
       (format #f "~a" (make-array 1 0 0 1)))
+
+  (pass-if-equal "empty typed 3-array with last nonempty dim."
+      "#3f64:0:0:1()"
+      (format #f "~a" (make-typed-array 'f64 1 0 0 1)))
   
   (pass-if-equal "empty 3-array with middle nonempty dim."
       "#3:0:1:0()"