Skip to content

Commit

Permalink
Revert "Revert "Test Array.gist limits output to 100 els""
Browse files Browse the repository at this point in the history
This reverts commit 1b814c6.
  • Loading branch information
zoffixznet committed Dec 20, 2017
1 parent ad0069b commit 5a0beb5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion S02-types/array.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 103;
plan 104;

#L<S02/Mutable types/Array>

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

subtest '.gist shows only first 100 els' => {
plan 5;
sub make-gist ($a, $extras?) {
"[$a" ~ (" $extras" with $extras) ~ ']'
}

is [<1 2 3>].gist, '[1 2 3]', 'gist gives useful value';
is-deeply [1..100] .gist, make-gist([1..100] ), '100 els';
is-deeply [1..101] .gist, make-gist([1..100], '...'), '101 els';
is-deeply [1..102] .gist, make-gist([1..100], '...'), '102 els';
is-deeply [1..1000].gist, make-gist([1..100], '...'), '1000 els';
}

# vim: ft=perl6

0 comments on commit 5a0beb5

Please sign in to comment.