File: 05predicate.t

package info (click to toggle)
libstruct-dumb-perl 0.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 160 kB
  • sloc: perl: 468; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 283 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

use Struct::Dumb;

struct Point => [qw( x y )], predicate => "is_Point";

my $point = Point(10, 20);
ok( is_Point( $point ), '$point is a Point' );

ok( !is_Point( [] ), 'unblessed ARRAYref is not a Point' );

done_testing;