Skip to content

Commit 399367c

Browse files
committed
Test Array.gist limits output to 100 els
Rakudo impl: rakudo/rakudo@5b71d902c3
1 parent 92cbeac commit 399367c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

S02-types/array.t

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 103;
5+
plan 104;
66

77
#L<S02/Mutable types/Array>
88

@@ -390,4 +390,17 @@ subtest 'flat propagates .is-lazy' => {
390390
is-deeply flat(42 xx 1) .is-lazy, False, 'sub, False';
391391
}
392392

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+
393406
# vim: ft=perl6

0 commit comments

Comments
 (0)