summaryrefslogtreecommitdiffstats
path: root/t/fun/state.t
blob: 7b8f8fb989c6980ac229ad81eca613c665c01956 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;