Debian Codegraph @

t/range.t

raw symbols SCIP
1 #!/usr/bin/env perl
2 use strictscip-perl cpan autobox-Core 1.33 strict/;
3 use warningsscip-perl cpan autobox-Core 1.33 warnings/;
4 use Test::Morescip-perl cpan autobox-Core 1.33 Test/More/ tests => 4;
5 use autobox::Corescip-perl cpan autobox-Core 1.33 autobox/Core/;
6
7 my @array = qw(foo bar baz gorch);
8
9 okscip-perl cpan autobox-Core 1.33 main/ok(). @array->rangescip-perl cpan autobox-Core 1.33 main/range().(0,1);
10 is_deeply [@array->rangescip-perl cpan autobox-Core 1.33 main/range().(0,1)], ['foo', 'bar'];
11
12 my @slice = @array->rangescip-perl cpan autobox-Core 1.33 main/range().(0,2);
13
14 isscip-perl cpan autobox-Core 1.33 main/is(). scalarscip-perl cpan autobox-Core 1.33 main/scalar(). @slice, 3, "Returns an array in list context";
15
16 my $slice = @array->rangescip-perl cpan autobox-Core 1.33 main/range().(0,2);
17
18 isscip-perl cpan autobox-Core 1.33 main/is(). refscip-perl cpan autobox-Core 1.33 main/ref(). $slice, 'ARRAY', "Returns an arrayref in scalar context";