Browse files

Basic test up front to make sure Any::Moose works

  • Loading branch information...
1 parent 8daf324 commit 41b44555881a22a576aaf0ab22f9efadb52a7e71 @sartak committed Sep 15, 2011
Showing with 35 additions and 0 deletions.
  1. +35 −0 t/001-basic.t
View
35 t/001-basic.t
@@ -0,0 +1,35 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+do {
+ package Point;
+ use Any::Moose;
+
+ has ['x', 'y'] => (
+ is => 'rw',
+ isa => 'Int',
+ );
+
+ sub BUILDARGS {
+ my ($class, $x, $y) = @_;
+ return { x => $x, y => $y };
+ }
+};
+
+my $origin = Point->new(0, 0);
+is($origin->x, 0);
+is($origin->y, 0);
+
+my $aa = Point->new(1, 1);
+is($aa->x, 1);
+is($aa->y, 1);
+
+$aa->x(-1);
+
+is($aa->x, -1);
+is($aa->y, 1);
+
+done_testing;
+

0 comments on commit 41b4455

Please sign in to comment.