Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created July 29, 2019 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaniel/8262b1638945378d6f7f3fa7ce017217 to your computer and use it in GitHub Desktop.
Save AlexDaniel/8262b1638945378d6f7f3fa7ce017217 to your computer and use it in GitHub Desktop.
use Test;
plan 6;
my %data = :a(1), :b(2), :c(3);
{
sub demo (%positional, :$named)
{
state %state = %positional;
is-deeply %state, %positional, 'sub demo(%positional, :$named)';
}
demo(%data);
}
{
multi demo (%positional, :$named)
{
state %state = %positional;
is-deeply %state, %positional, 'multi demo(%positional, :$named)';
}
demo(%data);
}
{
sub demo (%positional)
{
state %state = %positional;
is-deeply %state, %positional, 'sub demo(%positional)';
}
demo(%data);
}
{
multi demo (%positional)
{
state %state = %positional;
is-deeply %state, %positional, 'multi demo(%positional)';
}
demo(%data);
}
{
sub demo (%positional, :$named)
{{
state %state = %positional;
is-deeply %state, %positional, 'sub demo(%positional, :$named) {{...}}';
}}
demo(%data);
}
{
multi demo (%positional, :$named)
{{
state %state = %positional;
is-deeply %state, %positional, 'multi demo(%positional, :$named) {{...}}';
}}
demo(%data);
}
done-testing;
=finish
{
multi demo (%positional, :$named)
{{
state %state = %positional;
dd 'multi{{}}', %positional, %state, '_' x 50;
}}
my %data = :a(1), :b(2), :c(3);
demo(%data);
demo(%data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment