Initial prototype
[p5sagit/Gather-Once.git] / t / basic.t
CommitLineData
14342f72 1use strict;
2use warnings;
3use Test::More 0.89;
4
5use Gather::Once
6 block => 'with',
7 take => 'iff',
8 topicalise => 1,
9 predicate => sub {
10 warn "$_[0] == $_[1]";
11 $_[0] == $_[1];
12 };
13
14my $n = 42;
15
16my @ret = with ($n) {
17 warn 42;
18 iff (42) { 23 };
19 warn 23;
20 42;
21};
22
23diag explain \@ret;
24
25use Gather::Once
26 block => 'moo',
27 take => 'iff_',
28 predicate => sub {
29 warn scalar @_;
30 warn "$_[0]";
31 !!$_[0]
32 };
33
34=for later
35iff_ (42) { };
36=cut
37
38my @ret_ = moo {
39 iff_ (42) { 1, 2, 3 };
40};
41
42diag explain \@ret_;
43
44done_testing;