4 use Test::More tests => 11;
6 use_ok("CXGN::Cview::Chromosome::Vector");
7 use_ok("CXGN::Cview::Marker::VectorFeature");
9 my $v = CXGN::Cview::Chromosome::Vector->new();
14 my $m1 = CXGN::Cview::Marker::VectorFeature->new($v);
15 $m1->set_range_coords(500, 1000);
17 my $start = $m1->get_start();
19 is ($start, 500, "feature start coord test");
21 my $end = $m1->get_end();
23 is ($end, 1000, "feature end coord test");
25 my $offset = $m1->get_offset();
27 is($offset, (500+1000)/2, "offset test");
28 is($m1->get_north_range(), 250, "north range test");
29 is($m1->get_south_range(), 250, "south range test");
32 my $angle = $v->angle($start);
34 is((sprintf "%5.4f", $angle), 2.0944, "angle test");
36 my ($x, $y) = $v->mapunits2pixels($start);
38 is( (sprintf "%4.1f", $x), 86.6, "mapunits2pixels x test");
40 is( (sprintf "%4.1f", $y), "-50.0", "mapunits2pixels y test");
44 my $m2 = CXGN::Cview::Marker::VectorFeature->new($v);
46 $m2->set_range_coords(1500, 2500);
50 is($v->get_markers(), 2, "marker test");