summaryrefslogtreecommitdiffstats
path: root/t/fun/state.t
blob: 68f2c1749f72e3654d4a6a947865dc06a990417f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use lib 't/fun/lib';

use Test::Requires 'Sub::Name';

use 5.10.0;
use Fun;

fun bar ($y) {
    state $x = 10;
    $x * $y;
}

is(bar(3), 30);

done_testing;