summaryrefslogtreecommitdiffstats
path: root/t/fun/state.t
diff options
context:
space:
mode:
Diffstat (limited to 't/fun/state.t')
-rw-r--r--t/fun/state.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/fun/state.t b/t/fun/state.t
new file mode 100644
index 0000000..7b8f8fb
--- /dev/null
+++ b/t/fun/state.t
@@ -0,0 +1,18 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Test::More;
+use lib 't/fun/lib';
+
+use 5.10.0;
+use Fun;
+
+fun bar ($y) {
+ state $x = 10;
+ $x * $y;
+}
+
+is(bar(3), 30);
+
+done_testing;