The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# -*- mode: perl; coding: utf-8; tab-width: 4 -*-

use strict;
# use Test::More qw(no_plan);
use Test::More tests => 17;

BEGIN {
	use_ok('Cv');
	use_ok('Cv::Seq::Circle');
}

my $stor = Cv::MemStorage->new;

if (1) {
	my $seq = bless Cv::Seq->new(CV_32FC4), 'Cv::Seq::Circle';

	$seq->push([[ 1, 2 ], 3 ]);
	my $x = $seq->pop;
	is($x->[0]->[0], 1);
	is($x->[0]->[1], 2);
	is($x->[1], 3);

	$seq->push([[ 11, 12 ], 13 ],
			   [[ 21, 22 ], 23 ],
		);
	my @x = $seq->toArray;
	is($x[0]->[0]->[0], 11);
	is($x[0]->[0]->[1], 12);
	is($x[0]->[1], 13);
	is($x[1]->[0]->[0], 21);
	is($x[1]->[0]->[1], 22);
	is($x[1]->[1], 23);

	# overload
	@x = @$seq;
	is($x[0]->[0]->[0], 11);
	is($x[0]->[0]->[1], 12);
	is($x[0]->[1], 13);
	is($x[1]->[0]->[0], 21);
	is($x[1]->[0]->[1], 22);
	is($x[1]->[1], 23);
}