File: 43grid.t

package info (click to toggle)
libmath-polygon-perl 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 256 kB
  • sloc: perl: 1,598; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 4;

use lib '../lib';
use Math::Polygon::Transform;
use Math::Polygon::Calc       qw/polygon_string/;

my @p = ( [1,1], [2.45,2.55], [-1.45, -1.55] );

is( polygon_string(polygon_grid raster => 0, @p)
  , "[1,1], [2.45,2.55], [-1.45,-1.55]"
  , "identity"
  );

is( polygon_string(polygon_grid @p)
  , "[1,1], [2,3], [-1,-2]"
  , "grid 1"
  );

is( polygon_string(polygon_grid raster => 2.5, @p)
  , "[0,0], [2.5,2.5], [-2.5,-2.5]"
  , "grid 2.5"
  );

is( polygon_string(polygon_grid raster => 0.25, @p)
  , "[1,1], [2.5,2.5], [-1.5,-1.5]"
  , "grid 0.5"
  );