Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created November 23, 2016 14:00
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 zoffixznet/d336de239f98d438ef8ad3578fd75023 to your computer and use it in GitHub Desktop.
Save zoffixznet/d336de239f98d438ef8ad3578fd75023 to your computer and use it in GitHub Desktop.
use Test;
use MONKEY-GUTS;
sub is-deeply-junction (
Junction $got, Junction $expected, Str:D $desc
) is export {
sub junction-guts (Junction $j) {
my $st = nqp::getattr(nqp::decont($j), Junction, '$!storage');
do for ^nqp::elems(nqp::decont($st)) {
given nqp::atpos(nqp::decont($st), $_) {
when Junction { junction-guts($_).Slip }
$_
}
}
}
is-deeply junction-guts($got), junction-guts($expected), $desc;
}
constant @a = (2, 3|4, 5, 6|7);
my $sum = @a.reduce: *+*;
is-deeply-junction $sum, any(any(16, 17), any(17, 18)), 'tis same';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment