Skip to content

Instantly share code, notes, and snippets.

Created December 23, 2017 10:15
Show Gist options
  • Save anonymous/87d71b864e7e076f8c42308c2ea80105 to your computer and use it in GitHub Desktop.
Save anonymous/87d71b864e7e076f8c42308c2ea80105 to your computer and use it in GitHub Desktop.
Perl 6 variable as a key of a named argument
use v6;
use Test;
use My-Module;
my @opt = <opt1 opt2 opt3>;
for @opt -> $key {
lives-ok { my $n = My-Module.new( $key => 1 ) }, "option name $key ok";
}
done-testing();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment