summaryrefslogtreecommitdiffstats
path: root/t/basic.t
diff options
context:
space:
mode:
Diffstat (limited to 't/basic.t')
-rw-r--r--t/basic.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/basic.t b/t/basic.t
index 119e586..8171972 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -16,4 +16,26 @@ use Test::More;
::is_deeply([bar], [1, 2, 3]);
}
+{
+ package Bar;
+
+ use Parse::Keyword { baz => \&baz_parser };
+
+ my $code;
+
+ sub baz { $code = $_[0] }
+ sub baz_parser {
+ lex_read_space;
+ my $block = parse_block;
+ return (sub { $block }, 1);
+ }
+
+ baz {
+ my $foo = 1;
+ return $foo + 2;
+ }
+ ::is(ref($code), 'CODE');
+ ::is($code->(), 3);
+}
+
done_testing;