File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use Test ;
4
4
5
- plan 103 ;
5
+ plan 104 ;
6
6
7
7
# L<S02/Mutable types/Array>
8
8
@@ -390,4 +390,17 @@ subtest 'flat propagates .is-lazy' => {
390
390
is-deeply flat (42 xx 1 ) . is-lazy , False , ' sub, False' ;
391
391
}
392
392
393
+ subtest ' .gist shows only first 100 els' => {
394
+ plan 5 ;
395
+ sub make-gist ($ a , $ extras ? ) {
396
+ " [$ a" ~ (" $ extras" with $ extras ) ~ ' ]'
397
+ }
398
+
399
+ is [<1 2 3 >]. gist , ' [1 2 3]' , ' gist gives useful value' ;
400
+ is-deeply [1 .. 100 ] . gist , make-gist([1 .. 100 ] ), ' 100 els' ;
401
+ is-deeply [1 .. 101 ] . gist , make-gist([1 .. 100 ], ' ...' ), ' 101 els' ;
402
+ is-deeply [1 .. 102 ] . gist , make-gist([1 .. 100 ], ' ...' ), ' 102 els' ;
403
+ is-deeply [1 .. 1000 ]. gist , make-gist([1 .. 100 ], ' ...' ), ' 1000 els' ;
404
+ }
405
+
393
406
# vim: ft=perl6
You can’t perform that action at this time.
0 commit comments