Moose used an incorrect cast at the C-level resulting in errors with >2**32 IV's...
[gitmo/Mouse.git] / t / 900_bug / 005_more_than_32_bit_int_on_32_bit_systems.t
diff --git a/t/900_bug/005_more_than_32_bit_int_on_32_bit_systems.t b/t/900_bug/005_more_than_32_bit_int_on_32_bit_systems.t
new file mode 100644 (file)
index 0000000..2d65957
--- /dev/null
@@ -0,0 +1,23 @@
+package MyInteger;
+use Mouse;
+
+has a_int => (
+    is => 'rw',
+    isa => 'Int',
+);
+
+has a_num => (
+    is => 'rw',
+    isa => 'Num',
+);
+
+package main;
+use Test::More tests => 212 * 2;
+
+for (my $i = 1; $i <= 10e100; $i += $i * 2) {
+    my $int = MyInteger->new( a_int => $i )->a_int;
+    cmp_ok($int, '==', $i, "Mouse groked the Int $i");
+
+    my $num = MyInteger->new( a_num => $i )->a_num;
+    cmp_ok($num, '==', $i, "Mouse groked the Num $i");
+}