File: cycle.t

package info (click to toggle)
libtie-cycle-perl 1.225-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 144 kB
  • sloc: perl: 51; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 338 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use Test::More;

use Tie::Cycle;

my @array = qw( A B C );

tie my $cycle, 'Tie::Cycle', \@array;

foreach( 0 .. 2 ) {
	is( $cycle, $array[0], "Cycle is first element, iteration $_" );
	is( $cycle, $array[1], "Cycle is second element, iteration $_" );
	is( $cycle, $array[2], "Cycle is third element, iteration $_" );
	}

done_testing();