summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-08-18 21:04:41 -0500
committerJesse Luehrs <doy@tozt.net>2012-08-18 21:04:41 -0500
commit67eb34f20e39635062c508101f9c107006e94246 (patch)
treeb2586514d2012c90e7ffae02837664c7db123a16
parent7b834c33ef2b0838f92151e73d1a27c8db536131 (diff)
downloadfun-67eb34f20e39635062c508101f9c107006e94246.tar.gz
fun-67eb34f20e39635062c508101f9c107006e94246.zip
couple more tests
-rw-r--r--t/anon.t4
-rw-r--r--t/recursion.t2
2 files changed, 6 insertions, 0 deletions
diff --git a/t/anon.t b/t/anon.t
index 844fb97..059aa57 100644
--- a/t/anon.t
+++ b/t/anon.t
@@ -9,4 +9,8 @@ my $fun = fun ($x, $y) { $x * $y };
is($fun->(3, 4), 12);
+my $fun2 = fun ($z, $w = 10) { $z / $w };
+
+is($fun2->(60), 6);
+
done_testing;
diff --git a/t/recursion.t b/t/recursion.t
index 0b13da9..5c3c29b 100644
--- a/t/recursion.t
+++ b/t/recursion.t
@@ -22,4 +22,6 @@ fun fact ($n) {
is(fact(5), 120);
+is(fun ($n = 8) { $n < 2 ? 1 : $n * __SUB__->($n - 1) }->(), 40320);
+
done_testing;