Permalink
Browse files

Fun tests.

  • Loading branch information...
1 parent de7a5ce commit 5c1d95da411c715e1a8f81915c3286cbfcb61dee @colomon committed Jan 29, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 t/03-playing.t
View
@@ -0,0 +1,23 @@
+use Math::BigInt;
+use Test;
+
+plan *;
+
+{
+ my $a = Math::BigInt.new(1);
+ for 1..50 {
+ $a = $a * $_;
+ }
+ isa_ok $a, Math::BigInt, "50! is a BigInt";
+ is $a, "30414093201713378043612608166064768844377641568960512000000000000",
+ "and it's 30414093201713378043612608166064768844377641568960512000000000000";
+}
+
+{
+ my @fib := Math::BigInt.new(1), Math::BigInt.new(1), *+* ... *;
+ isa_ok @fib[200], Math::BigInt, "201st Fib is a BigInt";
+ is ~@fib[200], "453973694165307953197296969697410619233826",
+ "201st Fib is 453973694165307953197296969697410619233826";
+}
+
+done;

0 comments on commit 5c1d95d

Please sign in to comment.