use Evo '-Lib *', '-Want *';
use Test::More;

my ($context, @args, @got);
my $fn = sub {
  @got = @_;
  $_++ for @_;
  $context = wantarray;
};

# list
@args = (1, 2);
@got = ();
context_run(WANT_LIST, @args, $fn);
is_deeply \@args, [2, 3];
ok want_is_list($context);
is_deeply \@got, [1, 2];


@args = (1, 2);
@got = ();
context_run(WANT_SCALAR, @args, $fn);
is_deeply \@args, [2, 3];
ok want_is_scalar($context);
is_deeply \@got, [1, 2];

@args = (1, 2);
@got = ();
context_run(WANT_VOID, @args, $fn);
is_deeply \@args, [2, 3];
ok want_is_void($context);
is_deeply \@got, [1, 2];

done_testing;
