This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Brendan Byrd is now a perl AUTHOR
[perl5.git] / ext / arybase / t / index.t
1 use warnings; no warnings 'deprecated';
2 use strict;
3
4 use Test::More tests => 12;
5
6 our $t = "abcdefghijkl";
7
8 $[ = 3;
9
10 is index($t, "cdef"), 5;
11 is index($t, "cdef", 3), 5;
12 is index($t, "cdef", 4), 5;
13 is index($t, "cdef", 5), 5;
14 is index($t, "cdef", 6), 2;
15 is index($t, "cdef", 7), 2;
16 is rindex($t, "cdef"), 5;
17 is rindex($t, "cdef", 7), 5;
18 is rindex($t, "cdef", 6), 5;
19 is rindex($t, "cdef", 5), 5;
20 is rindex($t, "cdef", 4), 2;
21 is rindex($t, "cdef", 3), 2;
22
23 1;