Created
December 23, 2017 10:15
-
-
Save anonymous/87d71b864e7e076f8c42308c2ea80105 to your computer and use it in GitHub Desktop.
Perl 6 variable as a key of a named argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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