summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2017-02-07 15:49:11 +0100
committerDaniel Llorens <daniel.llorens@bluewin.ch>2017-02-07 15:56:40 +0100
commit93cbaef1345d1ba09c584bbeac6acd4580b23d73 (patch)
treee0c38c9108bb422d1ce38bad9f03841a36376e5c /test-suite
parentee2125c63973e5ebef2a04eb60d85e6a2b3ea412 (diff)
Fix rank 0 arrays and nested arrays in truncated-print
* module/ice-9/pretty-print.scm (print): In the array case, pass #:inner? along to (print-sequence), unless we're at the last dimension of the array. Special case for 0-rank arrays, which cannot be empty and have no length. * test-suite/tests/print.test: Test some of the cases fixed by this patch.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/tests/print.test29
1 files changed, 28 insertions, 1 deletions
diff --git a/test-suite/tests/print.test b/test-suite/tests/print.test
index 836fa2271..82cc77603 100644
--- a/test-suite/tests/print.test
+++ b/test-suite/tests/print.test
@@ -147,6 +147,18 @@
(pass-if-equal "#<directory (test-…>"
(tprint (current-module) 20 "UTF-8"))
+ (pass-if-equal "#0(#)"
+ (tprint (make-typed-array #t 9.0) 6 "UTF-8"))
+
+ (pass-if-equal "#0(9.0)"
+ (tprint (make-typed-array #t 9.0) 7 "UTF-8"))
+
+ (pass-if-equal "#0f64(#)"
+ (tprint (make-typed-array 'f64 9.0) 8 "UTF-8"))
+
+ (pass-if-equal "#0f64(9.0)"
+ (tprint (make-typed-array 'f64 9.0) 10 "UTF-8"))
+
(pass-if-equal "#"
(tprint (make-typed-array 's32 0 20 20) 7 "UTF-8"))
@@ -160,4 +172,19 @@
(tprint (make-typed-array 's32 0 20 20) 12 "UTF-8"))
(pass-if-equal "#2s32((0 …) …)"
- (tprint (make-typed-array 's32 0 20 20) 14 "UTF-8")))
+ (tprint (make-typed-array 's32 0 20 20) 14 "UTF-8"))
+
+ (pass-if-equal "#2((#(9 9) #(9 9)) (#(9 9) #(9 9)))"
+ (tprint (make-typed-array #t (make-typed-array #t 9 2) 2 2) 40 "UTF-8"))
+
+ (pass-if-equal "#(#2((9 9) (9 9)) #2((9 9) (9 9)))"
+ (tprint (make-vector 2 (make-typed-array #t 9 2 2)) 40 "UTF-8"))
+
+ (pass-if-equal "(#2((9 9) (9 9)) #2((9 9) (9 9)))"
+ (tprint (make-list 2 (make-typed-array #t 9 2 2)) 40 "UTF-8"))
+
+ (pass-if-equal "(#0(9) #0(9))"
+ (tprint (make-list 2 (make-typed-array #t 9)) 20 "UTF-8"))
+
+ (pass-if-equal "(#0(9) #)"
+ (tprint (make-list 2 (make-typed-array #t 9)) 10 "UTF-8")))