6 use lib "$FindBin::Bin/lib";
9 use Catalyst::Test 'TestApp';
11 is get('/df_foo/msg'), 'foo', 'dynamic final with active final';
12 is get('/df_bar/msg/wrapped'), 'wrapped[bar]', 'dynamic final with non-final and attached actions';
14 my $make_counter = sub {
15 my ($ctrl, $counter) = @_;
16 return sub { scalar get(sprintf '/df_%s/counter/%s', $ctrl, $counter) };
19 my $foo_x = $make_counter->(qw( foo x ));
20 my $foo_y = $make_counter->(qw( foo y ));
21 my $bar_y = $make_counter->(qw( bar y ));
22 my $bar_z = $make_counter->(qw( bar z ));
25 is $foo_x->(), $_, "foo closure state test x $_";
26 is $foo_y->(), $_, "foo closure state test y $_";
30 is $bar_y->(), $_, "bar closure state test y $_";
31 is $bar_z->(), $_, "bar closure state test z $_";
35 is $foo_x->(), $_, "foo closure state test x $_";
36 is $bar_y->(), $_, "bar closure state test y $_";
40 is $foo_y->(), $_, "foo closure state test y $_";
41 is $bar_z->(), $_, "bar closure state test z $_";