File: first_index.t

package info (click to toggle)
libautobox-core-perl 1.33-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 428 kB
  • ctags: 135
  • sloc: perl: 578; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 224 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env perl

use autobox::Core;
use Test::More tests => 3;

my @numbers = ( 1 .. 10 );

is( @numbers->first_index, 0 );
is( @numbers->first_index( sub { $_[0] > 9 } ), 9 );

is( @numbers->first_index( qr/^2/ ), 1 );