Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/t.p6 Secret

Created July 5, 2016 13:30
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 jnthn/36792fd1bbb7fe834b86ec0502a1b668 to your computer and use it in GitHub Desktop.
Save jnthn/36792fd1bbb7fe834b86ec0502a1b668 to your computer and use it in GitHub Desktop.
use v6;
use Test;
plan 3;
{
my ($m1, $m2, $m3);
multi sub pkgname-pkgver-pkgrel(%txninfo, :@checks! where *.elems == 1) {
$m1 = True;
pkgname-pkgver-pkgrel(%txninfo, :checks(|@checks, %txninfo<pkgver>:exists));
}
multi sub pkgname-pkgver-pkgrel(%txninfo, :@checks! where *.elems == 2) {
$m2 = True;
pkgname-pkgver-pkgrel(%txninfo, :checks(|@checks, %txninfo<pkgrel>:exists));
}
multi sub pkgname-pkgver-pkgrel(%txninfo, :@checks! where *.elems == 3) {
$m3 = True;
@checks;
}
my %txninfo = :pkgname<name>, :pkgver<1.0>, :pkgrel(1);
pkgname-pkgver-pkgrel(%txninfo, :checks[%txninfo<pkgname>:exists]);
ok $m1, "Correctly reached first multi";
ok $m2, "Correctly reached second multi";
ok $m3, "Correctly reached third multi";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment